Skip to content

Commit

Permalink
Merge pull request #10 from pingcap-inc/feat-log
Browse files Browse the repository at this point in the history
feat: open loop
  • Loading branch information
Cheese authored Jun 24, 2024
2 parents 47cc286 + ddfec4e commit f6fa246
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions app/service/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@

logger = getLogger(__name__)

#
# def thread_loop():
# while True:
# try:
# incremental_loop()
# except Exception as e:
# logger.error(f"[Error {datetime.datetime.now()}] translate_or_update_first_page() {e}")
#
# if conf.sleep_time != 0:
# time.sleep(conf.sleep_time)
#
#
# def incremental_loop():
# translate_or_update_first_page()
#
#
# thread = threading.Thread(target=thread_loop)
# thread.setDaemon(True)
# thread.start()
# logger.info(f"Sync task is running now.")

def thread_loop():
while True:
try:
incremental_loop()
except Exception as e:
logger.error(f"[Error {datetime.datetime.now()}] translate_or_update_first_page() {e}")

if conf.sleep_time != 0:
time.sleep(conf.sleep_time)


def incremental_loop():
translate_or_update_first_page()


thread = threading.Thread(target=thread_loop)
thread.setDaemon(True)
thread.start()
logger.info(f"Sync task is running now.")

0 comments on commit f6fa246

Please sign in to comment.