File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 2
2
import os
3
3
from dotenv import load_dotenv
4
4
import datetime
5
- import aiohttp
6
5
import logging
7
6
8
7
class APIClient :
@@ -237,9 +236,11 @@ def report_api_version(self, client_id):
237
236
'api_version' : self .api_version ,
238
237
'timestamp' : timestamp
239
238
}
240
- async with aiohttp .ClientSession () as session :
241
- async with session .post (url , json = data ) as response :
242
- if response .status == 200 :
243
- logging .info (f"API-Version { self .api_version } erfolgreich gemeldet für Client { client_id } mit Timestamp { timestamp } " )
244
- else :
245
- logging .error (f"Fehler beim Melden der API-Version { self .api_version } für Client { client_id } mit Timestamp { timestamp } " )
239
+ try :
240
+ response = requests .post (url , json = data )
241
+ if response .status_code == 200 :
242
+ logging .info (f"API-Version { self .api_version } erfolgreich gemeldet für Client { client_id } mit Timestamp { timestamp } " )
243
+ else :
244
+ logging .error (f"Fehler beim Melden der API-Version { self .api_version } für Client { client_id } mit Timestamp { timestamp } " )
245
+ except Exception as e :
246
+ logging .error (f"Fehler beim Melden der API-Version: { e } " )
You can’t perform that action at this time.
0 commit comments