mirror of
https://github.com/webrecorder/browsertrix-crawler.git
synced 2025-10-19 14:33:17 +00:00
saved state tweaks: (#809)
- if saved state filename is somehow duplicated, don't readd to array to avoid deletion (fixes edge case in #791) - also avoid double interpolation of filename
This commit is contained in:
parent
41b968baac
commit
fd41b32100
1 changed files with 4 additions and 4 deletions
|
@ -2766,7 +2766,9 @@ self.__bx_behaviors.selectMainBehavior();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.saveStateFiles.push(filename);
|
if (!this.saveStateFiles.includes(filename)) {
|
||||||
|
this.saveStateFiles.push(filename);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.saveStateFiles.length > this.params.saveStateHistory) {
|
if (this.saveStateFiles.length > this.params.saveStateHistory) {
|
||||||
const oldFilename = this.saveStateFiles.shift();
|
const oldFilename = this.saveStateFiles.shift();
|
||||||
|
@ -2779,9 +2781,7 @@ self.__bx_behaviors.selectMainBehavior();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.storage && done && this.params.saveState === "always") {
|
if (this.storage && done && this.params.saveState === "always") {
|
||||||
const targetFilename = interpolateFilename(filenameOnly, this.crawlId);
|
await this.storage.uploadFile(filename, filenameOnly);
|
||||||
|
|
||||||
await this.storage.uploadFile(filename, targetFilename);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue