@@ -2,12 +2,9 @@ import json
|
||||
|
||||
import pika
|
||||
|
||||
from app.core.config import RABBITMQ_PARAMS
|
||||
|
||||
|
||||
def publish_status(task_id, progress, result):
|
||||
connection = pika.BlockingConnection(pika.ConnectionParameters(**RABBITMQ_PARAMS))
|
||||
# connection = pika.BlockingConnection(pika.ConnectionParameters('10.1.2.190'))
|
||||
connection = pika.BlockingConnection(pika.ConnectionParameters('10.1.2.213'))
|
||||
channel = connection.channel()
|
||||
channel.queue_declare(queue='DesignBatch', durable=True)
|
||||
message = {'task_id': task_id, 'progress': progress, "result": result}
|
||||
@@ -18,7 +15,3 @@ def publish_status(task_id, progress, result):
|
||||
delivery_mode=2,
|
||||
))
|
||||
connection.close()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
publish_status("1", "1", "1")
|
||||
|
||||
Reference in New Issue
Block a user