Skip to content

Commit

Permalink
fix: update watchdog if no email are forwarded
Browse files Browse the repository at this point in the history
  • Loading branch information
fl42 committed Nov 24, 2024
1 parent ffb95ef commit aef809c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion imap2imap.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ def run(self) -> None:
)
sleep_time += random_delta

self.watchdog = time()

self.log.debug("Waiting %.2f seconds...", sleep_time)
self.exit_event.wait(sleep_time)
self.log.info("Exited")
Expand Down Expand Up @@ -195,7 +197,7 @@ def forward(self, src_imap_config, dest_imap_config):
counter_failure += 1
self.log.error("Failed to forward message %s", msg_id)

# Update watchdog for each message processed to avoid timeout for large mailboxes
# Update watchdog also for each message processed to avoid timeout for large mailboxes
self.watchdog = time()

self.src_imap.expunge()
Expand Down

0 comments on commit aef809c

Please sign in to comment.