Skip to content

Commit

Permalink
Serialize Redis pending pages as JSON objects (#212)
Browse files Browse the repository at this point in the history
* Add redis:// prefix to test --redisStoreUrl

* Serialize pending pages as JSON objects
  • Loading branch information
tw4l authored Jan 24, 2023
1 parent a767721 commit c0b0d5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/redis_crawl_state.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import child_process from "child_process";
test("ensure crawl run with redis passes", async () => {
const redis = child_process.spawn("docker run -d --name test-crawl-redis -p 6379:6379 redis");

child_process.execSync("docker run -v $PWD/test-crawls:/crawls webrecorder/browsertrix-crawler crawl --url http://www.example.com/ --generateWACZ --text --collection redis-crawl --redisStoreUrl 127.0.0.1:6379 --workers 2");
child_process.execSync("docker run -v $PWD/test-crawls:/crawls webrecorder/browsertrix-crawler crawl --url http://www.example.com/ --generateWACZ --text --collection redis-crawl --redisStoreUrl redis://127.0.0.1:6379 --workers 2");

redis.kill("SIGINT");
});
Expand Down
2 changes: 1 addition & 1 deletion util/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ return 0;
async serialize() {
const queued = await this._iterListKeys(this.qkey);
const done = await this._iterListKeys(this.dkey);
const pending = await this.redis.hvals(this.pkey);
const pending = await this.getPendingList();

return {queued, pending, done};
}
Expand Down

0 comments on commit c0b0d5b

Please sign in to comment.