mirror of
https://github.com/norohind/SquadsActivityMonitor.git
synced 2026-12-04 01:45:09 +03:00
Add logging for models
This commit is contained in:
3 files changed
+9
-2
No files matched your search
@@ -27,12 +27,15 @@ class PostgresModel(AbstractModel):
|
||||
database=os.environ['DB_DATABASE'], # test0
|
||||
cursor_factory=psycopg2.extras.DictCursor)
|
||||
|
||||
logger.info(f'Connected to {self.db.dsn}')
|
||||
|
||||
with self.db:
|
||||
with self.db.cursor() as cursor:
|
||||
cursor.execute(postgres_sql_requests.schema_create) # schema creation
|
||||
|
||||
def close_model(self):
|
||||
self.db.close()
|
||||
logger.info(f'Connection to {self.db.dsn} closed successfully')
|
||||
|
||||
def get_activity_changes(self, platform: str, leaderboard_type: str, limit: int, low_timestamp, high_timestamp)\
|
||||
-> list:
|
||||
|
||||
Reference in new issue
Block a user