Skip to content

Commit 37b80d1

Browse files
committed
need task minor changes
1 parent 459b8ae commit 37b80d1

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

say/api/need_api.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,6 @@ def patch(self, need_id):
298298
if 'cost' in request.form.keys():
299299
print("updating cost...")
300300
new_cost = int(request.form['cost'].replace(',', ''))
301-
print(f"Id: {need.id}")
302-
print(f"oldCost: {need._cost}")
303-
print(f"newCOst: {new_cost}")
304301
if (
305302
(
306303
sw_role in [SOCIAL_WORKER, COORDINATOR, NGO_SUPERVISOR]

say/celery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
'update-needs': {
2525
'task': 'say.tasks.update_needs.update_needs',
26-
'schedule': crontab(minute=0, hour='8,22'),
26+
'schedule': crontab(minute=30, hour='6'),
2727
},
2828
'report_to_family': {
2929
'task': 'say.tasks.report_to_family.report_to_families',

say/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Config(object):
7373

7474
# Celery
7575
BROKER = "redis"
76-
task_soft_time_limit = 60
76+
task_soft_time_limit = 120
7777
task_acks_late = True
7878
worker_prefetch_multiplier = 1
7979

say/models/need_model.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,12 +454,15 @@ def update(self, force=False):
454454
data = Crawler(self.link).get_data(force=force)
455455

456456
if data is None:
457+
print(f"Could not get data for: {self.id}")
457458
return
458459

459460
img = data['img']
460461
title = data['title']
461462
cost = data['cost']
462-
463+
print(f"Id: {self.id}")
464+
print(f"fetched title: {title}")
465+
print(f"fetched cost: {cost}")
463466
if img:
464467
self.img = img
465468

say/tasks/send_email.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ def get_subject_from_html(html):
2121
retry_backoff=True,
2222
retry_backoff_max=600,
2323
retry_kwargs={'max_retries': 80},
24-
soft_time_limit=60
2524
)
2625
def send_email(subject, to, html, cc=[], bcc=[]):
2726
if isinstance(to, str):

0 commit comments

Comments
 (0)