Skip to content

Commit

Permalink
Merge pull request #729 from wadeking98/feature-update-celery
Browse files Browse the repository at this point in the history
added support to celery 5+
  • Loading branch information
WadeBarnes authored Jun 1, 2022
2 parents c4580f5 + bb8bc66 commit cbf9ab5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ version: 2
jobs:
django-build:
docker:
- image: circleci/python:3.6.4
- image: circleci/python:3.9
steps:
- checkout
- run: sudo chown -R circleci:circleci /usr/local/bin
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.6/site-packages
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.9/site-packages
- restore_cache:
keys:
- app-pip-dependencies-{{ .Branch }}-{{ checksum "server/vcr-server/requirements.txt" }}
Expand Down
2 changes: 1 addition & 1 deletion docker/manage
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ build-api() {
#
# vcr-api
#
BASE_IMAGE="bcgovimages/von-image:py36-1.7-ew-0-s2i"
BASE_IMAGE="registry.access.redhat.com/ubi9/python-39:latest"

echo -e "\nBuilding vcr-api image from ${BASE_IMAGE}..."
${S2I_EXE} build \
Expand Down
8 changes: 4 additions & 4 deletions server/vcr-server/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ drf-generators>=0.3.0
debugpy

# aiohttp
aiohttp~=3.4.0
aiohttp~=3.7.4
aiohttp-wsgi~=0.8.1

asgiref~=3.1.2

# rest hooks and related
django-rest-hooks==1.5.0
git+https://github.com/wadeking98/django-rest-hooks@v1.7.0
drf-nested-routers
celery~=4.3.0
vine~=1.3.0
celery~=5.2.2
vine>=5.0.0,<6.0

# transitive dependency management
iniconfig<=1.0.1
Expand Down
8 changes: 4 additions & 4 deletions server/vcr-server/subscriptions/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from celery.exceptions import Retry
# from celery.result import AsyncResult
from celery.signals import celeryd_after_setup
from celery.task import Task
from celery import shared_task
from django.conf import settings

from subscriptions.models.Subscription import Subscription
Expand All @@ -30,8 +30,8 @@
# # )
# # )


class DeliverHook(Task):
@shared_task
def deliver_hook(Task):
max_retries = 5

def run(self, target, payload, instance_id=None, hook_id=None, **kwargs):
Expand Down Expand Up @@ -137,7 +137,7 @@ def deliver_hook_wrapper(target, payload, instance, hook):
)
# deliver_hook_error = DeliverHookError()
# result = DeliverHook.apply_async(kwargs=kwargs, link_error=deliver_hook_error.s())
result = DeliverHook.apply_async(kwargs=kwargs)
result = deliver_hook.apply_async(kwargs=kwargs)
result.forget()


Expand Down

0 comments on commit cbf9ab5

Please sign in to comment.