Skip to content

Commit

Permalink
Remove race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
0x9900 committed Feb 22, 2024
1 parent fca6c4a commit fb75963
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions eqsl/sendcard.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,10 @@ def main() -> None:
watch_filter = ADIFilter(opts.path, opts.adif)
logging.info('Sendcards watching %s for %s', opts.path, opts.adif)
for changes in watch(opts.path, watch_filter=watch_filter, debounce=3200, recursive=False):
if Change.deleted in [c for c, _ in changes]:
continue
for _, filename in changes:
logging.info('Calling send_cards with %s', filename)
send_cards(full_name, opts.show, opts.keep)
for change, filename in changes:
if change == Change.added:
logging.info('Calling send_cards with %s', filename)
send_cards(filename, opts.show, opts.keep)


if __name__ == "__main__":
Expand Down

0 comments on commit fb75963

Please sign in to comment.