mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-12 18:58:00 +00:00
ensure log level for workers gets updated
This commit is contained in:
parent
0576933b16
commit
cff3bc30b8
|
@ -141,6 +141,7 @@ class Connection(SqlConnection):
|
|||
return self.execute("SELECT * FROM inboxes WHERE accepted = 1").all(schema.Instance)
|
||||
|
||||
|
||||
# todo: check if software is different than stored row
|
||||
def put_inbox(self,
|
||||
domain: str,
|
||||
inbox: str | None = None,
|
||||
|
|
|
@ -276,7 +276,10 @@ class Config(View):
|
|||
raise HttpError(400, 'Invalid key')
|
||||
|
||||
with self.database.session() as conn:
|
||||
conn.put_config(data['key'], data['value'])
|
||||
value = conn.put_config(data['key'], data['value'])
|
||||
|
||||
if data['key'] == 'log-level':
|
||||
self.app.workers.set_log_level(value)
|
||||
|
||||
return Response.new({'message': 'Updated config'}, ctype = 'json')
|
||||
|
||||
|
@ -288,7 +291,10 @@ class Config(View):
|
|||
raise HttpError(400, 'Invalid key')
|
||||
|
||||
with self.database.session() as conn:
|
||||
conn.put_config(data['key'], ConfigData.DEFAULT(data['key']))
|
||||
value = conn.put_config(data['key'], ConfigData.DEFAULT(data['key']))
|
||||
|
||||
if data['key'] == 'log-level':
|
||||
self.app.workers.set_log_level(value)
|
||||
|
||||
return Response.new({'message': 'Updated config'}, ctype = 'json')
|
||||
|
||||
|
|
|
@ -118,10 +118,6 @@ class PushWorkers(list[PushWorker]):
|
|||
self._count: int = count
|
||||
|
||||
|
||||
def push_item(self, item: QueueItem) -> None:
|
||||
self.queue.put(item)
|
||||
|
||||
|
||||
def push_message(self, inbox: str, message: Message, instance: Instance) -> None:
|
||||
self.queue.put(PostItem(inbox, message, instance))
|
||||
|
||||
|
|
Loading…
Reference in a new issue