problem description
use time for scheduled tasks, but it will always be skipped for a while. Here is the log I set to print every 5 minutes.
the environmental background of the problems and what methods you have tried
it was originally thought that each sleep takes a long time (originally set to sleep 58 to 60), and then changed to the above sleep (1), there is still the above problem.
related codes
/ / Please paste the code text below (do not replace the code with pictures)
interval = 58 * 60
count = interval
while 1:
count -= 1
if count > 0:
if count % 300 == 0:
NORMAL_LOG(time.strftime(u"%Y-%m-%d %H:%M:%S", time.localtime(time.time())))
-sharp NORMAL_LOG("c:%d" % count)
time.sleep(1)
else:
try:
thread.start_new_thread(check_code_style, ())
except Exception:
tip_str = u""
NORMAL_LOG(tip_str)
send_email_to_myself(tip_str)
count = interval
what result do you expect? What is the error message actually seen?
the ideal state should not have skipped such a long time, did not report any errors, and found nothing after reading the relevant documents.