瀏覽代碼

:art: formatting

visuddhinanda 9 月之前
父節點
當前提交
47e5b5b11f
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      ai-translate/ai_translate/__init__.py

+ 4 - 4
ai-translate/ai_translate/__init__.py

@@ -20,7 +20,7 @@ def open_redis_cluster(config):
     return (cli, config['namespace'])
     return (cli, config['namespace'])
 
 
 
 
-def start_consumer(context, name, config, queue, callback,proxy):
+def start_consumer(context, name, config, queue, callback, proxy):
     logger.debug("open rabbitmq %s@%s:%d/%s with timeout %ds",
     logger.debug("open rabbitmq %s@%s:%d/%s with timeout %ds",
                  config['user'], config['host'], config['port'], config['virtual-host'], config['customer-timeout'])
                  config['user'], config['host'], config['port'], config['virtual-host'], config['customer-timeout'])
     connection = pika.BlockingConnection(
     connection = pika.BlockingConnection(
@@ -37,7 +37,7 @@ def start_consumer(context, name, config, queue, callback,proxy):
         handle_message(context, ch, method, properties.message_id,
         handle_message(context, ch, method, properties.message_id,
                        properties.content_type, json.loads(
                        properties.content_type, json.loads(
                            body, object_hook=SimpleNamespace),
                            body, object_hook=SimpleNamespace),
-                       callback,proxy, config['customer-timeout'])
+                       callback, proxy, config['customer-timeout'])
 
 
     channel.basic_consume(
     channel.basic_consume(
         queue=queue, on_message_callback=_callback, auto_ack=False)
         queue=queue, on_message_callback=_callback, auto_ack=False)
@@ -55,6 +55,6 @@ def launch(name, queue, config_file):
         openai_proxy = config['app'].get('openai-proxy', None)
         openai_proxy = config['app'].get('openai-proxy', None)
         logger.debug(f'openai_proxy:({openai_proxy})')
         logger.debug(f'openai_proxy:({openai_proxy})')
         start_consumer(redis_cli, name,
         start_consumer(redis_cli, name,
-                       config['rabbitmq'], 
-                       queue, config['app']['api-url'], 
+                       config['rabbitmq'],
+                       queue, config['app']['api-url'],
                        openai_proxy)
                        openai_proxy)