Skip to content

Commit

Permalink
FIX: update celery and fix revoke method
Browse files Browse the repository at this point in the history
  • Loading branch information
D10S0VSkY-OSS authored and D10S0VSkY-OSS committed Jan 10, 2022
1 parent ba6e58a commit c06dae7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/sld-api-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
- name: Build the Docker image with tag
working-directory: ./sld-api-backend
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKER_USERNAME }}/sld-api:2.1.1
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKER_USERNAME }}/sld-api:2.1.2

- name: Docker Push with tag
run: docker push ${{ secrets.DOCKER_USERNAME }}/sld-api:2.1.1
run: docker push ${{ secrets.DOCKER_USERNAME }}/sld-api:2.1.2

- name: Build the Docker image
working-directory: ./sld-api-backend
Expand Down
4 changes: 2 additions & 2 deletions sld-api-backend/api_v1/endpoints/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from sqlalchemy.orm import Session
from fastapi import APIRouter, Depends, HTTPException
from celery.result import AsyncResult
from celery.task.control import revoke
from config.celery_config import celery_app

from schemas import schemas
from security import deps
Expand All @@ -25,7 +25,7 @@
async def get_task_by_id(
task_id: str,
current_user: schemas.User = Depends(deps.get_current_active_user)):
result = revoke(task_id, terminate=True)
result = celery_app.control.revoke(task_id, terminate=True)
return {"result": f'REVOKE {task_id}'}


Expand Down

0 comments on commit c06dae7

Please sign in to comment.