Avances en sistema de deployment y configuracion.
This commit is contained in:
parent
25e52a9e25
commit
9a7ba03cd9
11 changed files with 1054 additions and 215 deletions
|
|
@ -8,6 +8,7 @@ from bs4 import BeautifulSoup
|
|||
import re
|
||||
from random import randint
|
||||
from core.mysql_wrapper import get_anunciosdb, get_tasksdb
|
||||
from core.config import monthly_new_ads_target, working_hours
|
||||
from core.scrapping_utils import UrlAttack
|
||||
from core.alerts import alert_master
|
||||
from db_layer.capturing_tasks_interface import capturing_interface
|
||||
|
|
@ -16,9 +17,6 @@ class Explorer():
|
|||
|
||||
sleep_time_no_work = 60
|
||||
sleep_time_no_service = 600
|
||||
working_hours = {'start': datetime.time(9, 0, 0),
|
||||
'end': datetime.time(21, 0, 0)}
|
||||
monthly_capture_target = 1000
|
||||
ad_types = {'1': 'alquiler',
|
||||
'2': 'venta'}
|
||||
|
||||
|
|
@ -95,7 +93,7 @@ class Explorer():
|
|||
return False
|
||||
|
||||
def in_working_hours(self):
|
||||
return Explorer.working_hours['start'] <= datetime.datetime.now().time() <= Explorer.working_hours['end']
|
||||
return working_hours['start'] <= datetime.datetime.now().time() <= working_hours['end']
|
||||
|
||||
def get_referencias_acquired_today(self):
|
||||
"""
|
||||
|
|
@ -123,8 +121,8 @@ class Explorer():
|
|||
cursor_result = self.anunciosdb.query(query_statement)
|
||||
new_referencias_last_30 = cursor_result.fetchone()[0]
|
||||
|
||||
deviation = (Explorer.monthly_capture_target - new_referencias_last_30) / Explorer.monthly_capture_target
|
||||
max_referencias = (Explorer.monthly_capture_target/30) * (1 + deviation)
|
||||
deviation = (monthly_new_ads_target - new_referencias_last_30) / monthly_new_ads_target
|
||||
max_referencias = (monthly_new_ads_target / 30) * (1 + deviation)
|
||||
|
||||
return max_referencias
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue