Skip to content

Commit 15c98ec

Browse files
authored
Merge pull request #2 from guix77/dev
Dev
2 parents 4cc9e8a + 542d25c commit 15c98ec

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

README.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,13 @@ services:
3232
restart: unless-stopped
3333
ports:
3434
- "8000:8000"
35-
environment:
36-
# Database path inside the container
37-
- DB_PATH=/app/data/whois_cache.db
3835
volumes:
39-
# Data persistence (WHOIS cache)
40-
- ./gptkit_data:/app/data
41-
```
42-
43-
### Environment Variables
36+
# Data persistence (WHOIS cache stored in /app/data/whois_cache.db)
37+
- gptkit_data:/app/data
4438

45-
| Variable | Description | Default |
46-
|----------|-------------|--------|
47-
| `DB_PATH` | Path to the SQLite database file | `whois_cache.db` |
39+
volumes:
40+
gptkit_data:
41+
```
4842
4943
## Development
5044

app/services/cache.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
import os
66

77
class WhoisCache:
8-
def __init__(self, db_path: str = None):
9-
self.db_path = db_path or os.getenv("DB_PATH", "whois_cache.db")
8+
def __init__(self):
9+
self.db_path = "data/whois_cache.db"
10+
os.makedirs(os.path.dirname(self.db_path), exist_ok=True)
1011
self._init_db()
1112

1213
def _init_db(self):

0 commit comments

Comments
 (0)