Skip to content

Commit 4f5468b

Browse files
committed
introduce queue_db_path to override location as /app/ is not usable on mac
1 parent e2eaf0c commit 4f5468b

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/target
22
/queue_db
3-
.env
3+
.env
4+
users.json

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,17 @@ A very specialized timeseries database created for events, logs, traces and metr
44

55
Its designed to allow users plug in their own s3 storage and buckets and have their stored to their accounts.
66
This way, timefusion is used as a compute and cache engine, not primary data storage.
7+
8+
## Configuration
9+
10+
Timefusion can be configured using the following environment variables:
11+
12+
| Variable | Description | Default |
13+
|----------|-------------|---------|
14+
| `PORT` | HTTP server port | `80` |
15+
| `PGWIRE_PORT` | PostgreSQL wire protocol port | `5432` |
16+
| `AWS_S3_BUCKET` | AWS S3 bucket name | Required |
17+
| `AWS_S3_ENDPOINT` | AWS S3 endpoint URL | `https://s3.amazonaws.com` |
18+
| `QUEUE_DB_PATH` | Path to the persistent queue database | `/app/queue_db` |
19+
20+
For local development, you can set `QUEUE_DB_PATH` to a location in your development environment.

src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,11 @@ async fn main() -> anyhow::Result<()> {
289289
}
290290
}
291291

292-
let queue = match PersistentQueue::new("/app/queue_db") {
292+
// Get queue DB path from environment variable or use default
293+
let queue_db_path = env::var("QUEUE_DB_PATH").unwrap_or_else(|_| "/app/queue_db".to_string());
294+
info!("Using queue DB path: {}", queue_db_path);
295+
296+
let queue = match PersistentQueue::new(&queue_db_path) {
293297
Ok(q) => {
294298
info!("PersistentQueue initialized successfully");
295299
Arc::new(q)

0 commit comments

Comments
 (0)