mirror of
https://github.com/webrecorder/browsertrix-crawler.git
synced 2025-10-19 06:23:16 +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;
|
||||
}
|
||||
|
||||
this.saveStateFiles.push(filename);
|
||||
if (!this.saveStateFiles.includes(filename)) {
|
||||
this.saveStateFiles.push(filename);
|
||||
}
|
||||
|
||||
if (this.saveStateFiles.length > this.params.saveStateHistory) {
|
||||
const oldFilename = this.saveStateFiles.shift();
|
||||
|
@ -2779,9 +2781,7 @@ self.__bx_behaviors.selectMainBehavior();
|
|||
}
|
||||
|
||||
if (this.storage && done && this.params.saveState === "always") {
|
||||
const targetFilename = interpolateFilename(filenameOnly, this.crawlId);
|
||||
|
||||
await this.storage.uploadFile(filename, targetFilename);
|
||||
await this.storage.uploadFile(filename, filenameOnly);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue