[bug] Fix bug 62027

This commit is contained in:
Sergey Konovalov
2023-04-16 01:38:48 +03:00
parent 290a23a3b5
commit d91ba29875
3 changed files with 6 additions and 7 deletions

View File

@ -289,7 +289,7 @@ var getOutputData = co.wrap(function* (ctx, cmd, outputData, key, optConn, optAd
let wopiParams = wopiClient.parseWopiCallback(ctx, userAuthStr);
if (!wopiParams) {
//todo rework ErrToReload to clean up on next open
yield cleanupCache(ctx);
yield cleanupCache(ctx, key);
}
}
break;
@ -409,10 +409,9 @@ function* getUpdateResponse(ctx, cmd) {
updateTask.statusInfo = statusInfo;
return updateTask;
}
var cleanupCache = co.wrap(function* (ctx) {
var cleanupCache = co.wrap(function* (ctx, docId) {
//todo redis ?
var res = false;
let docId = ctx.docId;
let list = [];
var removeRes = yield taskResult.remove(ctx, docId);
if (removeRes.affectedRows > 0) {
@ -420,7 +419,7 @@ var cleanupCache = co.wrap(function* (ctx) {
yield storage.deleteObjects(ctx, list);
res = true;
}
ctx.logger.debug("cleanupCache db.affectedRows=%d list.length=%d", removeRes.affectedRows, list.length);
ctx.logger.debug("cleanupCache docId=%s db.affectedRows=%d list.length=%d", docId, removeRes.affectedRows, list.length);
return res;
});
var cleanupCacheIf = co.wrap(function* (ctx, mask) {
@ -1087,7 +1086,7 @@ function* commandSfcCallback(ctx, cmd, isSfcm, isEncrypted) {
yield docsCoServer.cleanDocumentOnExitPromise(ctx, docId, true, callbackUserIndex);
if (isOpenFromForgotten) {
//remove forgotten file in cache
yield cleanupCache(ctx);
yield cleanupCache(ctx, docId);
}
} else {
storeForgotten = true;

View File

@ -87,7 +87,7 @@ function* getConvertStatus(ctx, docId, encryptedUserPassword, selectRes, opt_che
case commonDefines.FileStatus.NeedPassword:
status.err = row.status_info;
if (commonDefines.FileStatus.ErrToReload == row.status || commonDefines.FileStatus.NeedPassword == row.status) {
yield canvasService.cleanupCache(ctx);
yield canvasService.cleanupCache(ctx, docId);
}
break;
case commonDefines.FileStatus.NeedParams:

View File

@ -83,7 +83,7 @@ var checkFileExpire = function() {
//проверяем что никто не сидит в документе
let editorsCount = yield docsCoServer.getEditorsCountPromise(ctx, docId);
if(0 === editorsCount){
if (yield canvasService.cleanupCache(ctx)) {
if (yield canvasService.cleanupCache(ctx, docId)) {
currentRemovedCount++;
}
} else {