ߺ2ipSrSSKJr SSKJr SSKJrJrJrJr SSK J r SSK J r SSK Jr "SS 5rg ) zp Sync Module - Integration with Automation Daemon Manages sync operations, scheduling, and database integration )Path)datetime)DictAnyOptionalCallable)logger)Database) DirectorySyncc \rSrSrSrS\4SjrSS\S\\S\\ S \ \ \ 44S jjr S\S \S \ \ \ 44S jrS rSrg) SyncModulez] Sync module for unified daemon Integrates DirectorySync with database and scheduling system dbc<Xl[R"S5 g)zM Initialize sync module Args: db: Database instance for CRUD operations zSyncModule initializedN)rr info)selfrs /c:\PYTHON\Scheduler\modules\sync\sync_module.py__init__SyncModule.__init__s ,-N profile_id schedule_idprogress_callbackreturnc URRU5nU(d!SUS3n[R"U5 SUS.$US(d!SUS3n[R"U5 SUS.$URR U5(a"SUS3n[R"U5 SUSS .$[ R"5nURRUS US 9n[R"S US USUS35 [USUSS9nURUS9n U RS5(a.Sn [U S5S3n [R"SUS35 OSn Sn [R"SUS35 [ R"5n URRUU U U SU SU SU SU S 9 SUUU SU SU SU SX- R5S!.S".$![ agn [#U 5n[R"SUS#U35 URRUS$[ R"5US%9 SUUUS&.sSn A $Sn A ff=f)'a Execute a sync operation Args: profile_id: Sync profile ID schedule_id: Optional schedule ID (when triggered by scheduler) progress_callback: Optional callback for progress updates Returns: Dict with operation results (success, operation_id, stats, error) z Sync profile z not foundF)successerrorenabledz is disabledz1 is already running - skipping to prevent overlapT)rrskippedrunning)rstatus start_timezStarting sync operation z for profile z: name source_pathdestination_path)source destination)rerrorscompleted_with_errorsz error(s) occurredzSync operation z completed with errors completedNz completed successfully files_scanned files_copied files_deleted bytes_total) operation_idr!end_timer+r,r-r. error_message)r+r,r-r.duration_seconds)rr/rstatsz failed: failed)r/r!r0r1)rr/rr)rget_sync_profiler rwarninghas_running_sync_operationrnowcreate_sync_operationrr syncgetlenupdate_sync_operation total_seconds Exceptionstr)rrrrprofile error_msgr"r/ sync_enginer3r!r1r0es r execute_syncSyncModule.execute_syncs$''**:6' |:>I LL #$y9 9y!' |<@I NN9 %$y9 9 77 - -j 9 9' |3deI NN9 %$yTJ J\\^ ww44!!5  .|nM*UWX_`fXgWhij@ '}-#$67K  $$7H$IEyy""0#&uX#7"88J K >TUV$ $  ol^;RST ||~H GG ) ))!#O4">2#O4!-0+ *  ,(%*?%;$).$9%*?%;#(#7)1)>(M(M(O    AI LL?<. )M N GG ) ))!' * ! ,("   s C*G// I 9AII I  target_idc\[R"SUSU35 URX!S9nU$)z Execute scheduled sync operation Called by daemon when a schedule triggers Args: schedule_id: Schedule ID that triggered target_id: Sync profile ID (from schedule.target_id) Returns: Dict with execution results z Schedule z triggered for sync profile )rr)r rrE)rrrGresults r schedule_itemSyncModule.schedule_items8  i },H TU""i"Q rc0[R"S5 g)zCleanup module resourceszSyncModule cleanup completedN)r r)rs rcleanupSyncModule.cleanups 23r)r)NN)__name__ __module__ __qualname____firstlineno____doc__r rintrrrr@rrErJrM__static_attributes__rrr r s .8.&*04 mmc]m$H- m c3h m^c3h&4rr N)rSpathlibrrtypingrrrrlogurur core.databaser modules.sync.sync_enginer r rVrrr\s- 00"2T4T4r