Skip to content

no output when executing HttpService #14

Description

@git-unica
@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions