add sleep to make backend use less CPU
parent
feadd6ee29
commit
d5c9981efd
|
@ -5,7 +5,7 @@ from config import config
|
||||||
from db import db
|
from db import db
|
||||||
import logging
|
import logging
|
||||||
from sendmail import sendmail
|
from sendmail import sendmail
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
def shutdown():
|
def shutdown():
|
||||||
try:
|
try:
|
||||||
|
@ -39,6 +39,7 @@ if __name__ == '__main__':
|
||||||
for bot2 in bots:
|
for bot2 in bots:
|
||||||
bot2.post(user, status)
|
bot2.post(user, status)
|
||||||
logger.info("Resent: %d %s %s" % (user.uid, status.author, status.text))
|
logger.info("Resent: %d %s %s" % (user.uid, status.author, status.text))
|
||||||
|
sleep(1)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.error("Shutdown.", exc_info=True)
|
logger.error("Shutdown.", exc_info=True)
|
||||||
shutdown()
|
shutdown()
|
||||||
|
|
Loading…
Reference in New Issue