We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
def job(): global count logger.info("I'm doing a periodic job!" + str(count)) count = count + 1 time.sleep(30) # 每隔 2 分钟执行一次任务 job() schedule.every(2).minutes.do(job) while True: # logger.info("waiting for") schedule.run_pending() time.sleep(1)
the log is
2024-03-18 12:03:44,170 - INFO - I'm doing a periodic job!0 2024-03-18 12:06:14,534 - DEBUG - Running job Job(interval=2, unit=minutes, do=job, args=(), kwargs={}) 2024-03-18 12:06:14,535 - INFO - I'm doing a periodic job!1 2024-03-18 12:08:44,888 - DEBUG - Running job Job(interval=2, unit=minutes, do=job, args=(), kwargs={}) 2024-03-18 12:08:44,889 - INFO - I'm doing a periodic job!2 2024-03-18 12:11:15,267 - DEBUG - Running job Job(interval=2, unit=minutes, do=job, args=(), kwargs={}) 2024-03-18 12:11:15,267 - INFO - I'm doing a periodic job!3 2024-03-18 12:13:45,660 - DEBUG - Running job Job(interval=2, unit=minutes, do=job, args=(), kwargs={}) 2024-03-18 12:13:45,660 - INFO - I'm doing a periodic job!4
the code want job run every 2 minutes ,but it run every 2:30 minute , include the time the job costed.
Is this as expected? or Bug ?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
the log is
the code want job run every 2 minutes ,but it run every 2:30 minute , include the time the job costed.
Is this as expected? or Bug ?
The text was updated successfully, but these errors were encountered: