我将文件上传到 S3。在请求之后,我立即从 MonitoringManager 得到一个异常,我不知道我做错了什么。我们在我们的应用程序中使用了多个线程。
异常:断言失败。程序:... Monitor...ger.cpp 第 55 行表达式:s_monitors
cpp 文件:https ://github.com/aws/aws-sdk-cpp/blob/master/aws-cpp-sdk-core/source/monitoring/MonitoringManager.cpp第55行
uploadFileToS3(...);
方法'uploadFileToS3':
bool result = false;
const Aws::SDKOptions options;
Aws::InitAPI(options);
{
std::shared_ptr<Aws::Utils::Threading::Executor> m_executor = Aws::MakeShared<Aws::Utils::Threading::PooledThreadExecutor>("TransferTests", 4);
Aws::Transfer::TransferManagerConfiguration config(m_executor.get());
config.s3Client = client;
auto transmanager = Aws::Transfer::TransferManager::Create(config);
std::shared_ptr<Aws::Transfer::TransferHandle> handle = transmanager->UploadFile(fileDestination, Aws::String(S3_BUCKET_NAME),
Aws::String(s3key), Aws::String("multipart/form-data"), metadata);
handle->WaitUntilFinished();
result = isAwsActionSuccessful(handle) && boost::filesystem::remove(fileDestination);
}
Aws::ShutdownAPI(options);
return result;