feat(sync): Update Akte sync process to remove unused entity ID queue and streamline processing

This commit is contained in:
bsiggel
2026-03-26 11:22:04 +00:00
parent ef32373dc9
commit d9193f7993
2 changed files with 11 additions and 41 deletions

View File

@@ -127,10 +127,9 @@ async def handler(event_data: Dict[str, Any], ctx: FlowContext) -> None:
ctx.logger.info("🔄 aiAktivierungsstatus: new → aktiv")
await espocrm.update_entity('CAkten', akte_id, final_update)
# Clean up processing sets (both queues may have triggered this sync)
# Clean up processing set (Advoware Watcher queue)
if aktennummer:
redis_client.srem("advoware:processing_aktennummern", aktennummer)
redis_client.srem("akte:processing_entity_ids", akte_id)
ctx.logger.info("=" * 80)
ctx.logger.info("✅ AKTE SYNC COMPLETE")
@@ -143,12 +142,10 @@ async def handler(event_data: Dict[str, Any], ctx: FlowContext) -> None:
import traceback
ctx.logger.error(traceback.format_exc())
# Requeue for retry (into the appropriate queue(s))
# Requeue Advoware aktennummer for retry (Motia retries the akte.sync event itself)
import time
now_ts = time.time()
if aktennummer:
redis_client.zadd("advoware:pending_aktennummern", {aktennummer: now_ts})
redis_client.zadd("akte:pending_entity_ids", {akte_id: now_ts})
redis_client.zadd("advoware:pending_aktennummern", {aktennummer: time.time()})
try:
await espocrm.update_entity('CAkten', akte_id, {