def start(): try: data = request.get_json() if data: paused = data.get('paused') else: paused = None cron_manager.start(paused=paused) return jsonify({'status': 'ok', 'data': '调度器启动成功'}) except BaseException as e: return jsonify({'status': 'ok', 'data': '调度器启动失败: %s' % e})
def start(project_id): try: data = request.get_json() if data: paused = data.get('paused') else: paused = None cron_manager.start(paused=paused) return jsonify({'status': 'ok', 'data': '调度器启动成功'}) except BaseException as e: current_app.logger.error("start cron job failed. - %s" % str(e)) return jsonify({'status': 'ok', 'data': '调度器启动失败: %s' % e})