átlagos kiegészítséek jó sok
This commit is contained in:
@@ -59,10 +59,16 @@ class Settings(BaseSettings):
|
||||
)
|
||||
REDIS_URL: str = "redis://service_finder_redis:6379/0"
|
||||
|
||||
# --- MinIO S3 Storage ---
|
||||
MINIO_ENDPOINT: str = "sf_minio:9000"
|
||||
MINIO_ACCESS_KEY: str = "kincses"
|
||||
MINIO_SECRET_KEY: str = "MiskociA74"
|
||||
MINIO_SECURE: bool = False
|
||||
|
||||
@property
|
||||
def SQLALCHEMY_DATABASE_URI(self) -> str:
|
||||
"""
|
||||
Ez a property biztosítja, hogy a database.py és az Alembic
|
||||
"""
|
||||
Ez a property biztosítja, hogy a database.py és az Alembic
|
||||
megtalálja a kapcsolatot a várt néven.
|
||||
"""
|
||||
return self.DATABASE_URL
|
||||
|
||||
@@ -21,9 +21,9 @@ from apscheduler.jobstores.memory import MemoryJobStore
|
||||
|
||||
from app.database import AsyncSessionLocal
|
||||
from app.services.billing_engine import SmartDeduction
|
||||
from app.models.payment import WithdrawalRequest, WithdrawalRequestStatus
|
||||
from app.models.marketplace.payment import WithdrawalRequest, WithdrawalRequestStatus
|
||||
from app.models.identity import User
|
||||
from app.models.audit import ProcessLog, WalletType, FinancialLedger
|
||||
from app.models import ProcessLog, WalletType, FinancialLedger
|
||||
from sqlalchemy import select, update, and_
|
||||
from sqlalchemy.orm import selectinload
|
||||
|
||||
@@ -152,12 +152,16 @@ async def daily_financial_maintenance() -> None:
|
||||
stats["errors"].append(f"Soft downgrade error: {str(e)}")
|
||||
logger.error(f"Soft downgrade error: {e}", exc_info=True)
|
||||
|
||||
# D. Naplózás ProcessLog-ba
|
||||
# D. Naplózás ProcessLog-ba (JAVÍTOTT RÉSZ)
|
||||
process_log = ProcessLog(
|
||||
process_name="Daily-Financial-Maintenance",
|
||||
status="COMPLETED" if not stats["errors"] else "PARTIAL",
|
||||
details=stats,
|
||||
executed_at=datetime.utcnow()
|
||||
items_processed=stats["vouchers_expired"] + stats["withdrawals_rejected"] + stats["users_downgraded"],
|
||||
items_failed=len(stats["errors"]),
|
||||
end_time=datetime.utcnow(),
|
||||
details={
|
||||
"status": "COMPLETED" if not stats["errors"] else "PARTIAL",
|
||||
**stats
|
||||
}
|
||||
)
|
||||
db.add(process_log)
|
||||
await db.commit()
|
||||
@@ -166,12 +170,17 @@ async def daily_financial_maintenance() -> None:
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Daily financial maintenance failed: {e}", exc_info=True)
|
||||
# Hiba esetén is naplózzuk
|
||||
# Hiba esetén is naplózzuk a modellnek megfelelő mezőkkel
|
||||
process_log = ProcessLog(
|
||||
process_name="Daily-Financial-Maintenance",
|
||||
status="FAILED",
|
||||
details={"error": str(e), **stats},
|
||||
executed_at=datetime.utcnow()
|
||||
items_processed=0,
|
||||
items_failed=1,
|
||||
end_time=datetime.utcnow(),
|
||||
details={
|
||||
"status": "FAILED",
|
||||
"error": str(e),
|
||||
**stats
|
||||
}
|
||||
)
|
||||
db.add(process_log)
|
||||
await db.commit()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# /opt/docker/dev/service_finder/backend/app/models/validators.py (Javasolt új hely)
|
||||
# /opt/docker/dev/service_finder/backend/app/core/validators.py
|
||||
import hashlib
|
||||
import unicodedata
|
||||
import re
|
||||
|
||||
Reference in New Issue
Block a user