mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-11-30 04:44:54 +01:00
Reset state afecter chunked upload
This commit is contained in:
parent
6f20b97488
commit
9a62814c38
@ -414,6 +414,12 @@ export async function chunkedUpload(
|
|||||||
logger.debug("Chunked upload funished, assembling chunks.");
|
logger.debug("Chunked upload funished, assembling chunks.");
|
||||||
try {
|
try {
|
||||||
await assembleChunkedUpload(chunkedUrl, finalDestination, fileSize, config);
|
await assembleChunkedUpload(chunkedUrl, finalDestination, fileSize, config);
|
||||||
|
const status = statusTools.getStatus();
|
||||||
|
status.status = States.IDLE;
|
||||||
|
status.progress = undefined;
|
||||||
|
statusTools.setStatus(status);
|
||||||
|
logger.info(`...Upload finish !`);
|
||||||
|
fs.unlinkSync(localPath);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err instanceof RequestError) {
|
if (err instanceof RequestError) {
|
||||||
messageManager.error(
|
messageManager.error(
|
||||||
@ -482,7 +488,7 @@ export function initChunkedUpload(
|
|||||||
finalDestination: string,
|
finalDestination: string,
|
||||||
config: WebdavConfig
|
config: WebdavConfig
|
||||||
) {
|
) {
|
||||||
logger.debug(`Init chuncked upload.`);
|
logger.info(`Init chuncked upload.`);
|
||||||
logger.debug(`...URI: ${encodeURI(url)}`);
|
logger.debug(`...URI: ${encodeURI(url)}`);
|
||||||
logger.debug(`...Final destination: ${encodeURI(finalDestination)}`);
|
logger.debug(`...Final destination: ${encodeURI(finalDestination)}`);
|
||||||
return got(encodeURI(url), {
|
return got(encodeURI(url), {
|
||||||
@ -504,7 +510,7 @@ export function assembleChunkedUpload(
|
|||||||
config: WebdavConfig
|
config: WebdavConfig
|
||||||
) {
|
) {
|
||||||
const chunckFile = `${url}/.file`;
|
const chunckFile = `${url}/.file`;
|
||||||
logger.debug(`Assemble chuncked upload.`);
|
logger.info(`Assemble chuncked upload.`);
|
||||||
logger.debug(`...URI: ${encodeURI(chunckFile)}`);
|
logger.debug(`...URI: ${encodeURI(chunckFile)}`);
|
||||||
logger.debug(`...Final destination: ${encodeURI(finalDestination)}`);
|
logger.debug(`...Final destination: ${encodeURI(finalDestination)}`);
|
||||||
return got(encodeURI(chunckFile), {
|
return got(encodeURI(chunckFile), {
|
||||||
|
Loading…
Reference in New Issue
Block a user