Logging en explorer.py
This commit is contained in:
parent
acfeeef0d1
commit
c8ea77e99a
1 changed files with 4 additions and 2 deletions
|
|
@ -36,12 +36,13 @@ class Explorer:
|
|||
self.queue_retries = 0
|
||||
|
||||
def start(self):
|
||||
|
||||
logging.info("Starting explorer")
|
||||
while True:
|
||||
if not self.there_is_work():
|
||||
print("{}: Waiting. No work".format(datetime.datetime.now()))
|
||||
sleep(Explorer.sleep_time_no_work)
|
||||
continue
|
||||
logging.info("Waiting")
|
||||
|
||||
if not self.database_is_up():
|
||||
alert_master(
|
||||
|
|
@ -52,7 +53,7 @@ class Explorer:
|
|||
|
||||
current_task = ExploringTask(self.compose_listing_url())
|
||||
current_task.explore()
|
||||
print("{}: Exploring done".format(datetime.datetime.now()))
|
||||
logging.info("Exploring task done...")
|
||||
|
||||
if current_task.status == "Referencias ready":
|
||||
referencias = current_task.get_referencias()
|
||||
|
|
@ -61,6 +62,7 @@ class Explorer:
|
|||
referencia, current_task.id
|
||||
)
|
||||
current_task._update_status("Sent to queue")
|
||||
logging.info("The task was successful.")
|
||||
|
||||
continue
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue