Iniciado refresher.
This commit is contained in:
parent
e0216060b9
commit
8f5a120096
4 changed files with 164 additions and 69 deletions
30
refresher/refresher.py
Normal file
30
refresher/refresher.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
from time import sleep
|
||||
from db_layer.capturas_interface import capturas_interface
|
||||
from db_layer.capturing_tasks_interface import capturing_interface
|
||||
|
||||
class Refresher:
|
||||
|
||||
def start(self):
|
||||
|
||||
while True:
|
||||
sleep(30)
|
||||
|
||||
if capturas_interface.old_ads_exist():
|
||||
old_ad = capturas_interface.get_old_ad()
|
||||
capturing_interface.create_capturing_task(old_ad['referencia'])
|
||||
|
||||
|
||||
def dead_ad_checker(self, html):
|
||||
#TODO Comprueba si el anuncio esta muerto y, si es asi, lo marca en la tabla de capturas
|
||||
|
||||
|
||||
if blabla:
|
||||
capturas_interface.mark_dead_ad(referencia)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue