add sleep to make backend use less CPU

master
Egg 2023-01-14 23:26:46 +01:00
parent feadd6ee29
commit d5c9981efd
1 changed files with 2 additions and 1 deletions

View File

@ -5,7 +5,7 @@ from config import config
from db import db
import logging
from sendmail import sendmail
from time import sleep
def shutdown():
try:
@ -39,6 +39,7 @@ if __name__ == '__main__':
for bot2 in bots:
bot2.post(user, status)
logger.info("Resent: %d %s %s" % (user.uid, status.author, status.text))
sleep(1)
except Exception:
logger.error("Shutdown.", exc_info=True)
shutdown()