Skip to content

Commit

Permalink
clear out core dumps to avoid using up volume space: (#740)
Browse files Browse the repository at this point in the history
- add 'ulimit -c' to startup script
- delete any './core' files that exist in working dir just in case
- fixes #738
  • Loading branch information
ikreymer authored Jan 16, 2025
1 parent b7150f1 commit bc4a958
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh

# disable core dumps
ulimit -c 0

# Get UID/GID from volume dir

VOLUME_UID=$(stat -c '%u' /crawls)
Expand Down
8 changes: 8 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { logger } from "./util/logger.js";
import { setExitOnRedisError } from "./util/redis.js";
import { Crawler } from "./crawler.js";
import { ReplayCrawler } from "./replaycrawler.js";
import fs from "node:fs";

let crawler: Crawler | null = null;

Expand Down Expand Up @@ -56,4 +57,11 @@ if (process.argv[1].endsWith("qa")) {
crawler = new Crawler();
}

// remove any core dumps which could be taking up space in the working dir
try {
fs.unlinkSync("./core");
} catch (e) {
//ignore
}

await crawler.run();

0 comments on commit bc4a958

Please sign in to comment.