Skip to content

CreateJobAsync No Response #14

@wickedwick

Description

@wickedwick

I have a simple conversion use case. But it seems that CreateJobAsync hangs. During troubleshooting, I implemented creating a job via RestSharp and it completes just fine. I am seeing the same behavior with UploadAsync, and WaitJobAsync. Any idea what I'm doing wrong here?

var job = await _cloudConvert.CreateJobAsync(new JobCreateRequest
{
    Tasks = new
    {
        import_it = new ImportUploadCreateRequest(),
        convert = new ConvertCreateRequest
        {
            Input = "import_it",
            Input_Format = inputFormat,
            Output_Format = outputFormat
        },
        export_it = new ExportUrlCreateRequest
        {
            Input = "convert"
        }
    }
});

var uploadTask = job.Data.Tasks.FirstOrDefault(t => t.Name == "import");
var bytes = File.StoredFileAsByteArray(storedFile);

await _cloudConvert.UploadAsync(
    uploadTask?.Result.Form.Url.ToString(),
    bytes,
    storedFile.Name,
    uploadTask?.Result.Form.Parameters);

job = await _cloudConvert.WaitJobAsync(job.Data.Id); // Wait for job completion

var exportTask = job.Data.Tasks.FirstOrDefault(t => t.Name == "export_it");

var fileExport = exportTask.Result.Files.FirstOrDefault();
return fileExport.Url.ToString();

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