Добавлено восстановление файлов из webdav
This commit is contained in:
@@ -107,17 +107,11 @@ function initStatic(app, config) {
|
|||||||
|
|
||||||
//восстановим
|
//восстановим
|
||||||
if (!await fs.pathExists(filePath)) {
|
if (!await fs.pathExists(filePath)) {
|
||||||
/*const zlib = require('zlib');
|
if (req.path.indexOf('/tmp/') === 0) {
|
||||||
const gzipBuffer = async(buf) => {
|
await readerWorker.restoreRemoteFile(req.path, '/tmp');
|
||||||
return new Promise((resolve, reject) => {
|
} else if (req.path.indexOf('/upload/') === 0) {
|
||||||
zlib.gzip(buf, {level: 1}, (err, result) => {
|
await readerWorker.restoreRemoteFile(req.path, '/upload');
|
||||||
if (err) reject(err);
|
}
|
||||||
resolve(result);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
await fs.writeFile(filePath, await gzipBuffer(`<filepath>${filePath}</filepath>`));*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return next();
|
return next();
|
||||||
|
|||||||
Reference in New Issue
Block a user