提交暂存
This commit is contained in:
Binary file not shown.
Binary file not shown.
18
app/blueprints/communication.py
Normal file
18
app/blueprints/communication.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from queue import Empty
|
||||
|
||||
from flask import Blueprint, jsonify
|
||||
|
||||
from config import JSON_TASK_QUEUE
|
||||
|
||||
|
||||
communication_bp = Blueprint('communication', __name__)
|
||||
|
||||
|
||||
@communication_bp.route('/api/amazon/del_brand', methods=['GET', 'POST'])
|
||||
def del_brand():
|
||||
"""返回队列中的一个元素;队列为空时返回空提示。"""
|
||||
try:
|
||||
item = JSON_TASK_QUEUE.get_nowait()
|
||||
return jsonify({'success': True, 'data': item})
|
||||
except Empty:
|
||||
return jsonify({'success': False, 'message': '队列为空', 'data': None})
|
||||
Reference in New Issue
Block a user