@Command('video_job:callback {videoId}')
async videoJobCallback(_cli: ConsoleIO) {
const videoId = _cli.argument<number>('videoId');
const videoJob = await this.videosService.findJobByVideoId(videoId);
if (videoJob) {
if (!videoJob.callback_url) {
_cli.error('No callback_url');
return;
}
const video = videoJob.video;
if (!video) {
_cli.error(`No video: ${videoId}`);
return;
}
this.httpService
.post(videoJob.callback_url, {...})
.subscribe({
complete: () => {
_cli.success(`Post data to ${videoJob.callback_url}`);
},
error: (err) => {
_cli.error(`Error callback ${err.message}`);
},
});
} else {
_cli.info(`No job with video_id: ${videoId}`);
}
everything is fine, only _cli in subscribe is not printed to terminal,
The data is also updated properly via the above callback_url
everything is fine, only _cli in subscribe is not printed to terminal,
The data is also updated properly via the above callback_url