mirror of
https://github.com/ONLYOFFICE/server.git
synced 2026-04-07 14:04:35 +08:00
store indicator file near Editor.bin to determine if opening was from the forgotten file
This commit is contained in:
@ -589,7 +589,14 @@ function* commandSfcCallback(cmd, isSfcm) {
|
||||
try {
|
||||
let forgottenId = cfgForgottenFiles + '/' + docId;
|
||||
let forgotten = yield storage.listObjects(forgottenId);
|
||||
if (0 === forgotten.length) {
|
||||
let isSendHistory = 0 === forgotten.length;
|
||||
if (!isSendHistory) {
|
||||
//check indicator file to determine if opening was from the forgotten file
|
||||
var forgottenMarkPath = docId + '/' + cfgForgottenFilesName + '.txt';
|
||||
var forgottenMark = yield storage.listObjects(forgottenMarkPath);
|
||||
isSendHistory = 0 === forgottenMark.length;
|
||||
}
|
||||
if (isSendHistory) {
|
||||
//don't send history info because changes isn't from file in storage
|
||||
var data = yield storage.getObject(savePathHistory);
|
||||
outputSfc.setChangeHistory(JSON.parse(data.toString('utf-8')));
|
||||
|
||||
@ -59,6 +59,7 @@ var cfgFilePath = configConverter.get('filePath');
|
||||
var cfgArgs = configConverter.get('args');
|
||||
var cfgErrorFiles = configConverter.get('errorfiles');
|
||||
var cfgTokenEnableRequestOutbox = config.get('services.CoAuthoring.token.enable.request.outbox');
|
||||
const cfgForgottenFilesName = config.get('services.CoAuthoring.server.forgottenfilesname');
|
||||
|
||||
//windows limit 512(2048) https://msdn.microsoft.com/en-us/library/6e3b887c.aspx
|
||||
//Ubuntu 14.04 limit 4096 http://underyx.me/2015/05/18/raising-the-maximum-number-of-file-descriptors.html
|
||||
@ -523,6 +524,9 @@ function* ExecuteTask(task) {
|
||||
let list = yield utils.listObjects(tempDirs.source, false);
|
||||
if (list.length > 0) {
|
||||
dataConvert.fileFrom = list[0];
|
||||
//store indicator file to determine if opening was from the forgotten file
|
||||
var forgottenMarkPath = tempDirs.result + '/' + cfgForgottenFilesName + '.txt';
|
||||
fs.writeFileSync(forgottenMarkPath, cfgForgottenFilesName, {encoding: 'utf8'});
|
||||
} else {
|
||||
error = constants.UNKNOWN;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user