File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ services:
28
28
- spybot_pg_data:/var/lib/postgresql/data
29
29
secrets :
30
30
- db_password
31
+ ports :
32
+ - " 127.0.0.1:5432:5432"
31
33
redis :
32
34
image : redis:7.4.2-bookworm
33
35
volumes :
Original file line number Diff line number Diff line change 1
1
import traceback
2
- from threading import Thread
3
2
4
3
from ts3 import TS3Error
5
4
from ts3 .response import TS3ParserError
6
5
7
- from Spybot2 import settings
6
+ from django import db
7
+
8
8
from spybot .recorder .client import Client
9
9
from spybot .recorder .ts import TS
10
10
@@ -55,6 +55,10 @@ def main_loop(self):
55
55
(event_type , event ) = self .ts .wait_for_event ()
56
56
print (f"new Event of type { event_type } : { event } " )
57
57
58
+ # fix for closed database connection
59
+ # https://stackoverflow.com/a/78573290
60
+ db .close_old_connections ()
61
+
58
62
# parse and store in db
59
63
self .process_event (event_type , event )
60
64
You can’t perform that action at this time.
0 commit comments