warc prefix: support setting from WARC_PREFIX env var

bump version to 1.0.0-beta.4
This commit is contained in:
Ilya Kreymer 2024-02-21 10:26:39 -08:00
parent a512e92886
commit d969701070
2 changed files with 3 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{
"name": "browsertrix-crawler",
"version": "1.0.0-beta.3",
"version": "1.0.0-beta.4",
"main": "browsertrix-crawler",
"type": "module",
"repository": "https://github.com/webrecorder/browsertrix-crawler",

View file

@ -128,7 +128,8 @@ export class Recorder {
fs.mkdirSync(this.archivesDir, { recursive: true });
fs.mkdirSync(this.tempCdxDir, { recursive: true });
const prefix = crawler.params.warcPrefix || "rec";
const prefix =
process.env.WARC_PREFIX || crawler.params.warcPrefix || "rec";
const crawlId = process.env.CRAWL_ID || os.hostname();
const filenameTemplate = `${prefix}-${crawlId}-$ts-${this.workerid}.warc${
this.gzip ? ".gz" : ""