31 lines
642 B
Python
31 lines
642 B
Python
|
|
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)
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|