diff --git a/DocService/sources/canvasservice.js b/DocService/sources/canvasservice.js index 5095d037..87409a62 100644 --- a/DocService/sources/canvasservice.js +++ b/DocService/sources/canvasservice.js @@ -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; diff --git a/DocService/sources/converterservice.js b/DocService/sources/converterservice.js index d84a39dd..7cde776f 100644 --- a/DocService/sources/converterservice.js +++ b/DocService/sources/converterservice.js @@ -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: diff --git a/DocService/sources/gc.js b/DocService/sources/gc.js index ef316f2b..999aa9a9 100644 --- a/DocService/sources/gc.js +++ b/DocService/sources/gc.js @@ -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 {