Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 committed Nov 27, 2024
1 parent 57a9164 commit 4914c73
Show file tree
Hide file tree
Showing 22 changed files with 25 additions and 26 deletions.
6 changes: 0 additions & 6 deletions api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@
version_utils.check_supported_python_version()
threadings_utils.apply_gevent_threading_patch()

from flask import Flask

from app_factory import create_app


class DifyApp(Flask):
pass


# create app
app = create_app()
celery = app.extensions["celery"]
Expand Down
2 changes: 1 addition & 1 deletion api/app_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from flask import Flask

from app import DifyApp
from configs import dify_config
from dify_app import DifyApp
from extensions import (
ext_app_metrics,
ext_blueprints,
Expand Down
5 changes: 5 additions & 0 deletions api/dify_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from flask import Flask


class DifyApp(Flask):
pass
2 changes: 1 addition & 1 deletion api/extensions/ext_app_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from flask import Response

from app import DifyApp
from configs import dify_config
from dify_app import DifyApp


def init_app(app: DifyApp):
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_blueprints.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from app import DifyApp
from configs import dify_config
from dify_app import DifyApp


def init_app(app: DifyApp):
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from celery import Celery, Task
from celery.schedules import crontab

from app import DifyApp
from configs import dify_config
from dify_app import DifyApp


def init_app(app: DifyApp) -> Celery:
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_code_based_extension.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from app import DifyApp
from core.extension.extension import Extension
from dify_app import DifyApp


def init_app(app: DifyApp):
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_commands.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from app import DifyApp
from dify_app import DifyApp


def init_app(app: DifyApp):
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_compress.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from app import DifyApp
from configs import dify_config
from dify_app import DifyApp


def init_app(app: DifyApp):
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_database.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import MetaData

from app import DifyApp
from dify_app import DifyApp

POSTGRES_INDEXES_NAMING_CONVENTION = {
"ix": "%(column_0_label)s_idx",
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_hosting_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
hosting_configuration = HostingConfiguration()


from app import DifyApp
from dify_app import DifyApp


def init_app(app: DifyApp):
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_import_modules.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from app import DifyApp
from dify_app import DifyApp


def init_app(app: DifyApp):
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import sys
from logging.handlers import RotatingFileHandler

from app import DifyApp
from configs import dify_config
from dify_app import DifyApp


def init_app(app: DifyApp):
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_login.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from app import DifyApp
from dify_app import DifyApp


def init_app(app: DifyApp):
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from flask import Flask

from app import DifyApp
from configs import dify_config
from dify_app import DifyApp


class Mail:
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_migrate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from app import DifyApp
from dify_app import DifyApp


def init_app(app: DifyApp):
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_proxy_fix.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from app import DifyApp
from configs import dify_config
from dify_app import DifyApp


def init_app(app: DifyApp):
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from redis.connection import Connection, SSLConnection
from redis.sentinel import Sentinel

from app import DifyApp
from configs import dify_config
from dify_app import DifyApp


class RedisClientWrapper:
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_sentry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from app import DifyApp
from configs import dify_config
from dify_app import DifyApp


def init_app(app: DifyApp):
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def delete(self, filename):
storage = Storage()


from app import DifyApp
from dify_app import DifyApp


def init_app(app: DifyApp):
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_timezone.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import time

from app import DifyApp
from dify_app import DifyApp


def init_app(app: DifyApp):
Expand Down
2 changes: 1 addition & 1 deletion api/extensions/ext_warnings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from app import DifyApp
from dify_app import DifyApp


def init_app(app: DifyApp):
Expand Down

0 comments on commit 4914c73

Please sign in to comment.