modified: assets/dedupe.js modified: assets/split.js modified: blueprints/__pycache__/brand.cpython-311.pyc modified: blueprints/__pycache__/brand.cpython-39.pyc new file: blueprints/communication.py modified: config.py modified: main.py modified: new_web_source/convert.html modified: new_web_source/dedupe.html modified: new_web_source/split.html
19 lines
555 B
Python
19 lines
555 B
Python
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})
|