mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-22 14:38: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)
|
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,
|
def put_inbox(self,
|
||||||
domain: str,
|
domain: str,
|
||||||
inbox: str | None = None,
|
inbox: str | None = None,
|
||||||
|
|
|
@ -276,7 +276,10 @@ class Config(View):
|
||||||
raise HttpError(400, 'Invalid key')
|
raise HttpError(400, 'Invalid key')
|
||||||
|
|
||||||
with self.database.session() as conn:
|
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')
|
return Response.new({'message': 'Updated config'}, ctype = 'json')
|
||||||
|
|
||||||
|
@ -288,7 +291,10 @@ class Config(View):
|
||||||
raise HttpError(400, 'Invalid key')
|
raise HttpError(400, 'Invalid key')
|
||||||
|
|
||||||
with self.database.session() as conn:
|
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')
|
return Response.new({'message': 'Updated config'}, ctype = 'json')
|
||||||
|
|
||||||
|
|
|
@ -118,10 +118,6 @@ class PushWorkers(list[PushWorker]):
|
||||||
self._count: int = count
|
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:
|
def push_message(self, inbox: str, message: Message, instance: Instance) -> None:
|
||||||
self.queue.put(PostItem(inbox, message, instance))
|
self.queue.put(PostItem(inbox, message, instance))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue