File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,23 @@ def __init__(self, queue_processors: list[SmsQueueProcessor]):
187
187
ignore_directories = True
188
188
)
189
189
190
+ def on_moved (self , event : 'FileSystemEvent' ) -> None :
191
+ dest_path = os .path .abspath (event .dest_path )
192
+ for qp in self .queue_processors :
193
+ # only one queue processor should match
194
+ if dest_path .startswith (qp .path ):
195
+ try :
196
+ qp .send_messages ()
197
+ except Exception :
198
+ log .exception (
199
+ 'Encountered fatal exception when sending messages'
200
+ )
201
+ return
202
+
203
+ # NOTE: In the vast majority of cases the trigger will be a file system
204
+ # move since our DataManager creates a temporary file that then is
205
+ # moved. But we should also trigger when new files are created just
206
+ # in case this ever changes.
190
207
def on_created (self , event : 'FileSystemEvent' ) -> None :
191
208
src_path = os .path .abspath (event .src_path )
192
209
for qp in self .queue_processors :
You can’t perform that action at this time.
0 commit comments