You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gcgj-dify-1.7.0/api/initializer/__init__.py

16 lines
330 B
Python

from flask import Flask
from . import (
account,
workflow,
plugin
)
from .decorator import _initializers
import os
def run_initializers(app: Flask):
if os.environ.get("MODE") != "api":
return
with app.app_context():
for func, _ in sorted(_initializers, key=lambda x: x[1]):
func()