Compare commits

..

4 Commits

2 changed files with 58 additions and 47 deletions

View File

@ -260,6 +260,15 @@ class PublishDispatcher:
False, False,
False, False,
) )
async with self.pool.acquire() as log_connection:
await log_connection.set_type_codec(
'json',
encoder=dumps,
decoder=loads,
schema='pg_catalog'
)
async with log_connection.transaction():
risotto_context.log_connection = log_connection
async with self.pool.acquire() as connection: async with self.pool.acquire() as connection:
await connection.set_type_codec( await connection.set_type_codec(
'json', 'json',

View File

@ -64,10 +64,12 @@ class Logger:
d = {} d = {}
for key, value in row.items(): for key, value in row.items():
if key == 'data': if key == 'data':
if not value: if isinstance(value, dict):
pass
elif not value:
value = {} value = {}
# else: else:
# value = loads(value) value = loads(value)
elif key in ['start_date', 'stop_date']: elif key in ['start_date', 'stop_date']:
value = str(value) value = str(value)
d[key] = value d[key] = value