Muhammad Abdur Rahman Saad
refactor code according to comments
123f3e2
raw
history blame
515 Bytes
from flask import Blueprint, jsonify
from main import main as data_collection
from . import bp
@bp.route('/trigger-data-collection', methods=['GET'])
def trigger_data_collection():
"""
This endpoint manually triggers the data collection process defined in main.py.
HTTP Method: GET (you can switch to POST if you prefer).
"""
data_collection() # This calls the Prefect flow that orchestrates data collection
return jsonify({"message": "Data collection triggered successfully"}), 200