Timezone memes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2020-06-20 22:14:34 +02:00
parent 3afa6d7260
commit 1f0bf5bad3
2 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,6 @@
aio-pika
sentry-sdk
aioinflux
requests
requests
tzdata
tzlocal

View File

@ -17,6 +17,7 @@ import sentry_sdk
from aioinflux import InfluxDBClient
import config
import requests
import tzlocal
if config.SENTRY_DSN:
sentry_sdk.init(
@ -33,7 +34,7 @@ async def on_message(message: IncomingMessage):
Here it is to show that it's possible.
"""
msg_json = json.loads(message.body)
now = datetime.now()
now = datetime.now(tz=tzlocal.get_localzone())
r = requests.get(f"http://input-service/sample/{msg_json['tag']}")
r.raise_for_status()