Skip to content

Commit 86e3123

Browse files
authored
Merge pull request #920 from p2pu/2021-09-celery
Update celery and update beat service to ignore pid file
2 parents 375c7f6 + c5e4115 commit 86e3123

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ services:
4949
volumes:
5050
- .:/opt/app
5151
working_dir: /opt/app
52-
command: /opt/django-venv/bin/celery worker -A learnwithpeople --loglevel=INFO
52+
command: /opt/django-venv/bin/celery -A learnwithpeople worker --loglevel=INFO
5353
env_file: docker.env
5454
environment:
5555
- ADMIN_EMAIL=admin@localhost
@@ -70,7 +70,7 @@ services:
7070
volumes:
7171
- .:/opt/app
7272
working_dir: /opt/app
73-
command: /opt/django-venv/bin/celery beat -A learnwithpeople --loglevel=DEBUG --pidfile=/var/lib/celery/celerybeat.pid --schedule=/var/lib/celery/celerybeat-schedule
73+
command: /opt/django-venv/bin/celery -A learnwithpeople beat --loglevel=DEBUG --schedule=/var/lib/celery/celerybeat-schedule
7474
env_file: docker.env
7575
environment:
7676
- DATABASE_URL=postgres://lc:password@postgres:5432/lc

learnwithpeople/celery.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
# set the default Django settings module for the 'celery' program.
66
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'learnwithpeople.settings')
77

8-
from django.conf import settings
9-
108
app = Celery('proj')
11-
app.config_from_object('django.conf:settings')
12-
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
9+
app.config_from_object('django.conf:settings', namespace='CELERY')
10+
app.autodiscover_tasks()
1311

1412
@app.task(bind=True)
1513
def debug_task(self):

learnwithpeople/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,13 @@
230230
GA_TRACKING_ID = env('GA_TRACKING_ID', 'UA-0000000-00')
231231

232232
####### Celery config #######
233+
# TODO this might need to change to CELERY_BROKER_URL
233234
BROKER_URL = env('BROKER_URL', 'amqp://guest:guest@localhost//')
234235

235236

236237
from celery.schedules import crontab
237238

238-
CELERYBEAT_SCHEDULE = {
239+
CELERY_BEAT_SCHEDULE = {
239240
'send_reminders': {
240241
'task': 'studygroups.tasks.send_reminders',
241242
'schedule': crontab(minute='*/5'),

requirements.txt

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
amqp==1.4.9
1+
amqp==5.0.6
22
anyjson==0.3.3
33
appdirs==1.4.3
44
arrow==0.4.2
55
Babel==2.3.4
66
beautifulsoup4==4.6.3
7-
billiard==3.3.0.23
7+
billiard==3.6.4.0
88
bleach==3.1.5
99
boto==2.38.0
1010
boto3==1.7.3
1111
botocore==1.10.3
12+
cached-property==1.5.2
1213
cairocffi==0.9.0
1314
CairoSVG==2.1.3
14-
celery==3.1.25
15+
celery==5.1.2
1516
certifi==2019.3.9
1617
cffi==1.11.5
1718
chardet==3.0.4
19+
click==7.1.2
20+
click-didyoumean==0.0.3
21+
click-plugins==1.1.1
22+
click-repl==0.2.0
1823
cssselect==1.0.3
1924
cssselect2==0.2.1
2025
cssutils==1.0.2
@@ -41,15 +46,18 @@ html5lib==1.0.1
4146
httplib2==0.18.0
4247
icalendar==4.0.3
4348
idna==2.8
49+
importlib-metadata==4.8.1
4450
jmespath==0.9.3
45-
kombu==3.0.37
51+
kombu==5.1.0
4652
lxml==4.2.5
4753
Markdown==3.1.1
54+
mock==4.0.3
4855
olefile==0.44
4956
packaging==16.8
5057
phonenumberslite==7.7.0
5158
Pillow==6.2.0
5259
premailer==3.2.0
60+
prompt-toolkit==3.0.20
5361
psycopg2==2.7.3.1
5462
pycparser==2.19
5563
pygal==2.4.0
@@ -64,10 +72,14 @@ s3-backup-rotate==0.3.3
6472
s3transfer==0.1.13
6573
selenium==3.141.0
6674
six==1.11.0
75+
sqlparse==0.4.1
6776
tinycss2==0.6.1
6877
transifex-client==0.12.4
6978
twilio==6.8.0
79+
typing-extensions==3.10.0.2
7080
unicodecsv==0.14.1
7181
urllib3==1.25.2
72-
vine==1.1.3
82+
vine==5.0.0
83+
wcwidth==0.2.5
7384
webencodings==0.5.1
85+
zipp==3.5.0

0 commit comments

Comments
 (0)