我有一个用Java编写的AWS Lambda函数。此函数启动TranscriptionJob,然后等待响应:
while( true ){
transcriptionJob = awsClient.getTranscriptionJob(getJobRequest).getTranscriptionJob();
if( transcriptionJob.getTranscriptionJobStatus().equals(TranscriptionJobStatus.COMPLETED.name()) ){
System.out.println("AWS transcribe completed with " + transcriptionJob.getMedia().getMediaFileUri());
Date comleption = transcriptionJob.getCompletionTime();
// duration until response in seconds
long duration = (comleption.getTime()-awsTranscribeStart.getTime())/1000;
logger.log("AWS transcribe took " + duration + " seconds\n");
break;
}else if( transcriptionJob.getTranscriptionJobStatus().equals(TranscriptionJobStatus.FAILED.name()) ){
System.out.println("AWS transcribe failed: " + transcriptionJob.getFailureReason());
break;
}
System.out.println("Waiting for response...");
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
对于我较长的音频文件,转录作业最多需要10分钟才能完成,但Lambda功能限制为5分钟。 没有"转录工作完成事件"或类似的东西。(
)是否有针对此问题的解决方法或是否必须从AWS Lambda切换到其他内容?