ionelmc / python-redis-lock

Lock context manager implemented via redis SET NX EX and BLPOP.
https://pypi.python.org/pypi/python-redis-lock
BSD 2-Clause "Simplified" License
550 stars 78 forks source link

Acquired Lock multiple times with the multiprocess #111

Closed yuqiuwen closed 1 year ago

yuqiuwen commented 1 year ago

resulting logs of flask apscheduler :

[2023-08-03 16:00:00,070: INFO/MainProcess] Running job "job (trigger: cron[month='*', day='*', day_of_week='*', hour='*/2', minute='0'], next run at: 2023-08-03 18:00:00 CST)" (scheduled at 2023-08-03 16:00:00+08:00)
[2023-08-03 16:00:00,071: INFO/MainProcess] Acquired Lock('lock:98ee3627d6424416ae8dfd76d4892afb').
[2023-08-03 16:00:12,976: INFO/MainProcess] Job "job (trigger: cron[month='*', day='*', day_of_week='*', hour='*/2', minute='0'], next run at: 2023-08-03 18:00:00 CST)" executed successfully
[2023-08-03 16:00:12,978: INFO/MainProcess] Acquired Lock('lock:98ee3627d6424416ae8dfd76d4892afb').
[2023-08-03 16:00:12,981: WARNING/MainProcess] [2023-08-03 16:00:12,980] INFO in apscheduler_task: job id 98ee3627d6424416ae8dfd76d4892afb execute succeeded!
2023-08-03 16:00:12 | INFO | 139772488185600 | job id 98ee3627d6424416ae8dfd76d4892afb execute succeeded!
[2023-08-03 16:00:12,980: INFO/MainProcess] job id 98ee3627d6424416ae8dfd76d4892afb execute succeeded!