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: ansible.builtin.service:
name: celeryd name: celeryd
daemon_reload: yes daemon_reload: yes
enabled: yes
state: reloaded state: reloaded
- name: Start celerybeat - name: Start celerybeat
become: yes become: yes
ansible.builtin.service: ansible.builtin.service:
name: celerybeat name: celerybeat
enabled: yes
state: restarted state: restarted

View File

@ -36,6 +36,15 @@
- 'regluit.pth' - 'regluit.pth'
- 'opt.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 - name: Create keys directory
file: file:
path: "{{ project_path}}/settings/keys" 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 # decide which of the period tasks to add to the schedule
if '{{ deploy_type }}' == 'test': if '{{ deploy_type }}' == 'test':
CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB CELERYBEAT_SCHEDULE['send_test_email'] = SEND_TEST_EMAIL_JOB
CELERYBEAT_SCHEDULE['save_info_page'] = SAVE_INFO_PAGE_TEST
elif '{{ deploy_type }}' == 'prod': elif '{{ deploy_type }}' == 'prod':
# update the statuses of campaigns # update the statuses of campaigns
CELERYBEAT_SCHEDULE['update_active_campaign_statuses'] = UPDATE_ACTIVE_CAMPAIGN_STATUSES CELERYBEAT_SCHEDULE['update_active_campaign_statuses'] = UPDATE_ACTIVE_CAMPAIGN_STATUSES
@ -140,3 +141,5 @@ try:
from regluit.settings.local import * from regluit.settings.local import *
except ImportError: except ImportError:
pass pass
NOTIFICATION_LOCK_FILE = '/opt/regluit/.lock/send_notices'

View File

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