Proper event handling
This commit is contained in:
parent
02db2751c0
commit
033e4ec645
2 changed files with 4 additions and 7 deletions
|
|
@ -7,6 +7,3 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
# Import the syncDelta module to initialize it (this will register the scheduler)
|
||||
from modules.features.syncDelta import mainSyncDelta
|
||||
|
||||
# Run initial sync
|
||||
asyncio.create_task(mainSyncDelta.scheduled_sync())
|
||||
|
|
|
|||
|
|
@ -838,7 +838,7 @@ try:
|
|||
from modules.shared.eventManagement import eventManager
|
||||
|
||||
# Register scheduler only in production
|
||||
if APP_ENV_TYPE == "prod" or APP_ENV_TYPE == "dev":
|
||||
if APP_ENV_TYPE == "prod":
|
||||
# Schedule sync every 20 minutes (at minutes 00, 20, 40)
|
||||
eventManager.register_cron(
|
||||
job_id="dgsync",
|
||||
|
|
@ -852,9 +852,9 @@ try:
|
|||
logger.info("Registered DG ticket sync via EventManagement (every 20 minutes)")
|
||||
|
||||
# Run initial sync
|
||||
import asyncio
|
||||
asyncio.create_task(scheduled_sync())
|
||||
logger.info("Initial sync scheduled")
|
||||
#import asyncio
|
||||
#asyncio.create_task(scheduled_sync())
|
||||
#logger.info("Initial sync scheduled")
|
||||
else:
|
||||
logger.info(f"Skipping DG scheduler registration for ticket sync in env: {APP_ENV_TYPE}")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue