зеркало из https://github.com/nextcloud/desktop.git
Merge pull request #2865 from nextcloud/vfs_cfapi_dont_get_stuck
VFS CfAPI implementation shouldn't get stuck
This commit is contained in:
Коммит
737158e9b4
|
@ -52,7 +52,6 @@ void cfApiSendTransferInfo(const CF_CONNECTION_KEY &connectionKey, const CF_TRAN
|
|||
opParams.TransferData.Length.QuadPart = length;
|
||||
|
||||
const qint64 result = CfExecute(&opInfo, &opParams);
|
||||
Q_ASSERT(result == S_OK);
|
||||
if (result != S_OK) {
|
||||
qCCritical(lcCfApiWrapper) << "Couldn't send transfer info" << QString::number(transferKey.QuadPart, 16) << ":" << _com_error(result).ErrorMessage();
|
||||
}
|
||||
|
|
|
@ -307,9 +307,15 @@ void VfsCfApi::fileStatusChanged(const QString &systemFileName, SyncFileStatus f
|
|||
|
||||
void VfsCfApi::scheduleHydrationJob(const QString &requestId, const QString &folderPath)
|
||||
{
|
||||
Q_ASSERT(std::none_of(std::cbegin(d->hydrationJobs), std::cend(d->hydrationJobs), [=](HydrationJob *job) {
|
||||
const auto jobAlreadyScheduled = std::any_of(std::cbegin(d->hydrationJobs), std::cend(d->hydrationJobs), [=](HydrationJob *job) {
|
||||
return job->requestId() == requestId || job->folderPath() == folderPath;
|
||||
}));
|
||||
});
|
||||
|
||||
if (jobAlreadyScheduled) {
|
||||
qCWarning(lcCfApi) << "The OS submitted again a hydration request which is already on-going" << requestId << folderPath;
|
||||
emit hydrationRequestFailed(requestId);
|
||||
return;
|
||||
}
|
||||
|
||||
if (d->hydrationJobs.isEmpty()) {
|
||||
emit beginHydrating();
|
||||
|
|
Загрузка…
Ссылка в новой задаче