mirror of
https://github.com/webrecorder/browsertrix-crawler.git
synced 2025-10-19 06:23:16 +00:00
profiles: use a fixed profile dir instead of creating a new temp dir on each load (#858)
- Avoid accumulation of temp profile dirs if crawler is restarted multiple times, eg. if tmp dir is mapped to `/crawls` (as is in Browsertrix now), this prevents a proliferation of `/crawls/tmp/profile-*` dirs for each crawler restart. - Since profile is loaded each time, clear out existing profile dir. - bump to 1.6.4
This commit is contained in:
parent
742f56f008
commit
05eb101867
2 changed files with 6 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "browsertrix-crawler",
|
"name": "browsertrix-crawler",
|
||||||
"version": "1.6.3",
|
"version": "1.6.4",
|
||||||
"main": "browsertrix-crawler",
|
"main": "browsertrix-crawler",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"repository": "https://github.com/webrecorder/browsertrix-crawler",
|
"repository": "https://github.com/webrecorder/browsertrix-crawler",
|
||||||
|
|
|
@ -76,7 +76,11 @@ export class Browser {
|
||||||
screenWHRatio: number;
|
screenWHRatio: number;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.profileDir = fs.mkdtempSync(path.join(os.tmpdir(), "profile-"));
|
this.profileDir = path.join(os.tmpdir(), "btrixProfile");
|
||||||
|
if (fs.existsSync(this.profileDir)) {
|
||||||
|
fs.rmSync(this.profileDir, { recursive: true, force: true });
|
||||||
|
}
|
||||||
|
fs.mkdirSync(this.profileDir);
|
||||||
|
|
||||||
// must be provided, part of Dockerfile
|
// must be provided, part of Dockerfile
|
||||||
assert(process.env.GEOMETRY);
|
assert(process.env.GEOMETRY);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue