-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove TIME_INPUT_FORMATS from settings, comment redis commander from…
… docker compose, add ENCODING_TRANSCODING_CELERY_BROKER_URL to manage distant transcript and encode, create task to transcript and import transcription
- Loading branch information
Showing
9 changed files
with
571 additions
and
469 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from celery import Celery | ||
from .. import settings | ||
import logging | ||
logger = logging.getLogger(__name__) | ||
|
||
ENCODING_TRANSCODING_CELERY_BROKER_URL = getattr( | ||
settings, | ||
"ENCODING_TRANSCODING_CELERY_BROKER_URL", | ||
"" | ||
) | ||
|
||
importing_transcript_app = Celery( | ||
"importing_transcript_tasks", | ||
broker=ENCODING_TRANSCODING_CELERY_BROKER_URL | ||
) | ||
importing_transcript_app.conf.task_routes = { | ||
"pod.video_encode_transcript.importing_transcript_tasks.*": { | ||
"queue": "importing_transcript" | ||
} | ||
} | ||
|
||
|
||
# celery -A pod.video_encode_transcript.importing_tasks worker -l INFO -Q importing | ||
@importing_transcript_app.task | ||
def start_importing_transcript_task(video_id, msg, webvtt): | ||
"""Start the encoding of the video.""" | ||
print("Start the importing transcript of the video ID : %s" % video_id) | ||
from pod.video.models import Video | ||
from .transcript import save_vtt_and_notify | ||
video_to_encode = Video.objects.get(id=video_id) | ||
save_vtt_and_notify(video_to_encode, msg, webvtt) |
Oops, something went wrong.