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

@ -2,3 +2,5 @@ aio-pika
sentry-sdk sentry-sdk
aioinflux aioinflux
requests requests
tzdata
tzlocal

View File

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