Browse Source
Merge pull request #13175 from abpframework/EngincanV/issue-13152
Docs: Fix concurrency exception
pull/13180/head
Alper Ebiçoğlu
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
6 additions and
7 deletions
-
modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs
-
modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/IDocumentRepository.cs
-
modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/Documents/EFCoreDocumentRepository.cs
-
modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/Documents/MongoDocumentRepository.cs
|
|
|
@ -404,8 +404,7 @@ namespace Volo.Docs.Documents |
|
|
|
var sourceDocument = await source.GetDocumentAsync(project, documentName, languageCode, version, |
|
|
|
oldDocument?.LastSignificantUpdateTime); |
|
|
|
|
|
|
|
await _documentRepository.DeleteAsync(project.Id, sourceDocument.Name, sourceDocument.LanguageCode, |
|
|
|
sourceDocument.Version); |
|
|
|
await _documentRepository.DeleteAsync(project.Id, sourceDocument.Name, sourceDocument.LanguageCode, sourceDocument.Version, autoSave: true); |
|
|
|
await _documentRepository.InsertAsync(sourceDocument, true); |
|
|
|
|
|
|
|
Logger.LogInformation($"Document retrieved: {documentName}"); |
|
|
|
|
|
|
|
@ -23,6 +23,7 @@ namespace Volo.Docs.Documents |
|
|
|
string name, |
|
|
|
string languageCode, |
|
|
|
string version, |
|
|
|
bool autoSave = false, |
|
|
|
CancellationToken cancellationToken = default); |
|
|
|
|
|
|
|
Task<List<Document>> GetListAsync( |
|
|
|
|
|
|
|
@ -141,11 +141,11 @@ namespace Volo.Docs.Documents |
|
|
|
GetCancellationToken(cancellationToken)); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task DeleteAsync(Guid projectId, string name, string languageCode, string version, CancellationToken cancellationToken = default) |
|
|
|
public async Task DeleteAsync(Guid projectId, string name, string languageCode, string version, bool autoSave = false, CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
await DeleteAsync(x => |
|
|
|
x.ProjectId == projectId && x.Name == name && x.LanguageCode == languageCode && |
|
|
|
x.Version == version, cancellationToken: cancellationToken); |
|
|
|
x.Version == version, autoSave, cancellationToken: cancellationToken); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<Document> GetAsync(Guid id, CancellationToken cancellationToken = default) |
|
|
|
|
|
|
|
@ -49,12 +49,11 @@ namespace Volo.Docs.Documents |
|
|
|
x.Version == version, GetCancellationToken(cancellationToken)); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task DeleteAsync(Guid projectId, string name, string languageCode, string version, |
|
|
|
CancellationToken cancellationToken = default) |
|
|
|
public async Task DeleteAsync(Guid projectId, string name, string languageCode, string version, bool autoSave = false, CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
await DeleteAsync(x => |
|
|
|
x.ProjectId == projectId && x.Name == name && x.LanguageCode == languageCode && |
|
|
|
x.Version == version, cancellationToken: cancellationToken); |
|
|
|
x.Version == version, autoSave, cancellationToken: cancellationToken); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<List<Document>> GetListAsync(Guid? projectId, string version, string name, CancellationToken cancellationToken = default) |
|
|
|
|