Merge pull request #6 from EbookFoundation/celery-service

notices were not emitting because the celery user couldn't create lock files
master
Eric Hellman 2021-02-11 13:12:46 -05:00 committed by GitHub
commit 416ad20b03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 1 deletions

View File

@ -50,10 +50,12 @@
ansible.builtin.service:
name: celeryd
daemon_reload: yes
enabled: yes
state: reloaded
- name: Start celerybeat
become: yes
ansible.builtin.service:
name: celerybeat
enabled: yes
state: restarted

View File

@ -36,6 +36,15 @@
- 'regluit.pth'
- 'opt.pth'
- name: Create lock directory
file:
path: "{{ project_path}}/.lock"
state: directory
owner: "{{ user_name }}"
group: "www-data"
mode: 0775
- name: Create keys directory
file:
path: "{{ project_path}}/settings/keys"

View File

@ -105,6 +105,7 @@ CELERY_LOG_DIR = '/var/log/celery'
# decide which of the period tasks to add to the schedule
if '{{ deploy_type }}' == 'test':
CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB
CELERYBEAT_SCHEDULE['save_info_page'] = SAVE_INFO_PAGE_TEST
elif '{{ deploy_type }}' == 'prod':
# update the statuses of campaigns
CELERYBEAT_SCHEDULE['update_active_campaign_statuses'] = UPDATE_ACTIVE_CAMPAIGN_STATUSES
@ -140,3 +141,5 @@ try:
from regluit.settings.local import *
except ImportError:
pass
NOTIFICATION_LOCK_FILE = '/opt/regluit/.lock/send_notices'

View File

@ -1,5 +1,5 @@
- hosts: regluit-dev
gather_facts: true
gather_facts: false
tasks:
# Need to install python3.6 and pip first so Ansible will function
- name: Install python3.6 and pip for dev