Commit 59c0386
fix: address Greptile P1s — CLI-safe timezone import + DB connection leak
P1: `from django.utils import timezone` at module level crashes when
visitran is used as a standalone CLI without Django installed.
Wrapped in try/except with a minimal fallback that provides
timezone.now() via stdlib datetime.
P1: close_db_connection() was only called in the success path of
execute_run_command. On exception the connection leaked. Moved
to a finally block so it always runs regardless of outcome.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 3889e26 commit 59c0386
2 files changed
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
| |||
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
| 70 | + | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
| |||
0 commit comments