1
0
mirror of https://github.com/tiyn/stud.ip-crawler.git synced 2026-02-22 14:44:49 +01:00

log: added logging for jobs to finish

This commit is contained in:
TiynGER
2020-11-10 11:19:24 +01:00
parent bd4c9ab497
commit 719c89e7cf
3 changed files with 22 additions and 37 deletions

View File

@@ -17,8 +17,7 @@ class Database:
self.setup_db()
def connect(self):
"""
Connect to an existing database instance based on the object attributes.
"""Connect to an existing database instance based on the object attributes.
"""
return pymysql.connect(
host=self.HOST,
@@ -30,8 +29,7 @@ class Database:
)
def setup_db(self):
"""
Creates a database with tables.
"""Creates a database with tables.
"""
db = self.connect()
crs = db.cursor()
@@ -46,8 +44,7 @@ class Database:
log.debug(db)
def set_last_file_dl(self, file_id, time):
"""
Insert a downloaded file to the database.
"""Insert a downloaded file to the database.
Parameters:
file_id (string): id of the file downloaded
@@ -64,8 +61,7 @@ class Database:
db.commit()
def get_last_file_dl(self, file_id):
"""
Check when a file was downloaded.
"""Check when a file was downloaded.
Parameters:
file_id(string): id of the file to check