mirror of
https://github.com/HeyPuter/puter.git
synced 2025-01-23 22:40:20 +08:00
clean: filesystem batch
This commit is contained in:
parent
fb0a091506
commit
df20cb8e6c
@ -17,7 +17,7 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
const APIError = require('../../../api/APIError.js');
|
const APIError = require('../../../api/APIError.js');
|
||||||
const { relativeSelector, NodeUIDSelector } = require('../../../filesystem/node/selectors.js');
|
const { relativeSelector } = require('../../../filesystem/node/selectors.js');
|
||||||
const ERR_INVALID_PATHREF = 'Invalid path reference in path: ';
|
const ERR_INVALID_PATHREF = 'Invalid path reference in path: ';
|
||||||
const ERR_UNKNOWN_PATHREF = 'Unknown path reference in path: ';
|
const ERR_UNKNOWN_PATHREF = 'Unknown path reference in path: ';
|
||||||
|
|
||||||
|
@ -19,18 +19,15 @@
|
|||||||
const APIError = require("../../../api/APIError");
|
const APIError = require("../../../api/APIError");
|
||||||
const eggspress = require("../../../api/eggspress");
|
const eggspress = require("../../../api/eggspress");
|
||||||
const config = require("../../../config");
|
const config = require("../../../config");
|
||||||
const PathResolver = require("./PathResolver");
|
|
||||||
const { Context } = require("../../../util/context");
|
const { Context } = require("../../../util/context");
|
||||||
const Busboy = require('busboy');
|
const Busboy = require('busboy');
|
||||||
const { BatchExecutor } = require("../../../filesystem/batch/BatchExecutor");
|
const { BatchExecutor } = require("../../../filesystem/batch/BatchExecutor");
|
||||||
const { TeePromise } = require('@heyputer/putility').libs.promise;
|
const { TeePromise } = require('@heyputer/putility').libs.promise;
|
||||||
const { EWMA, MovingMode } = require("../../../util/opmath");
|
const { MovingMode } = require("../../../util/opmath");
|
||||||
const { get_app } = require('../../../helpers');
|
const { get_app } = require('../../../helpers');
|
||||||
const { valid_file_size } = require("../../../util/validutil");
|
const { valid_file_size } = require("../../../util/validutil");
|
||||||
const { OnlyOnceFn } = require("../../../util/fnutil.js");
|
const { OnlyOnceFn } = require("../../../util/fnutil.js");
|
||||||
|
|
||||||
const commands = require('../../../filesystem/batch/commands.js').commands;
|
|
||||||
|
|
||||||
module.exports = eggspress('/batch', {
|
module.exports = eggspress('/batch', {
|
||||||
subdomain: 'api',
|
subdomain: 'api',
|
||||||
verified: true,
|
verified: true,
|
||||||
@ -137,8 +134,6 @@ module.exports = eggspress('/batch', {
|
|||||||
const pending_operations = [];
|
const pending_operations = [];
|
||||||
const response_promises = [];
|
const response_promises = [];
|
||||||
const fileinfos = [];
|
const fileinfos = [];
|
||||||
let total = 0;
|
|
||||||
let total_tbd = true;
|
|
||||||
|
|
||||||
const on_nonfile_data_end = OnlyOnceFn(() => {
|
const on_nonfile_data_end = OnlyOnceFn(() => {
|
||||||
if ( request_error ) {
|
if ( request_error ) {
|
||||||
@ -223,10 +218,6 @@ module.exports = eggspress('/batch', {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let i = 0;
|
|
||||||
let ended = [];
|
|
||||||
let ps = [];
|
|
||||||
|
|
||||||
busboy.on('file', async (fieldname, stream, detais) => {
|
busboy.on('file', async (fieldname, stream, detais) => {
|
||||||
if ( batch_exe.total_tbd ) {
|
if ( batch_exe.total_tbd ) {
|
||||||
batch_exe.total_tbd = false;
|
batch_exe.total_tbd = false;
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2024 Puter Technologies Inc.
|
|
||||||
*
|
|
||||||
* This file is part of Puter.
|
|
||||||
*
|
|
||||||
* Puter is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published
|
|
||||||
* by the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
Loading…
Reference in New Issue
Block a user