Skip to content

Commit

Permalink
update backend/README
Browse files Browse the repository at this point in the history
  • Loading branch information
par4m committed Dec 3, 2023
1 parent cc3f83f commit fca7f85
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,14 @@ $ RUST_LOG=info ./target/release/reacher_backend
```

The server will then be listening on `http://127.0.0.1:8080`.

## Prune DB

- Start a PostgreSQL Server
- Start Reacher with Bulk Endpoints enabled.
- e.g `.env` :
RCH_ENABLE_BULK=1
DATABASE_URL="postgresql://user:temporary@localhost"
- Inside `.env` set `DAYS_OLD` e.g 1,2 etc
- Send a request to the Bulk End point and wait for the job id to be allotted.
- Build and Run `script` with `cargo run --bin prune_db`
2 changes: 1 addition & 1 deletion backend/src/bin/prune_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async fn main() -> Result<()> {
env_logger::init(); // Initialize the logger

let db_url = std::env::var("DATABASE_URL").expect("Unable to read DATABASE_URL env var");
let dry_mode: bool = std::env::var("DEBUG_MODE").is_ok();
let dry_mode: bool = std::env::var("DRY_RUN").is_ok();
let days_old_str = std::env::var("DAYS_OLD").expect("Unable to read DAYS_OLD env var");
let days_old: i32 = days_old_str
.parse()
Expand Down

0 comments on commit fca7f85

Please sign in to comment.