mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-16 12:55:52 +08:00
feat: add webapp clean up
This commit is contained in:
parent
4105c8ff70
commit
4785c061a9
@ -317,6 +317,10 @@ class AppService:
|
|||||||
db.session.delete(app)
|
db.session.delete(app)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
# clean up web app settings
|
||||||
|
if FeatureService.get_system_features().webapp_auth.enabled:
|
||||||
|
EnterpriseService.cleanup_webapp(app.id)
|
||||||
|
|
||||||
# Trigger asynchronous deletion of app and related data
|
# Trigger asynchronous deletion of app and related data
|
||||||
remove_app_and_related_data_task.delay(tenant_id=app.tenant_id, app_id=app.id)
|
remove_app_and_related_data_task.delay(tenant_id=app.tenant_id, app_id=app.id)
|
||||||
|
|
||||||
|
@ -58,3 +58,13 @@ class EnterpriseService:
|
|||||||
response = EnterpriseRequest.send_request("POST", "/webapp/access-mode", json=data)
|
response = EnterpriseRequest.send_request("POST", "/webapp/access-mode", json=data)
|
||||||
|
|
||||||
return response.get("result", False)
|
return response.get("result", False)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def cleanup_webapp(cls, app_id: str):
|
||||||
|
if not app_id:
|
||||||
|
raise ValueError("app_id must be provided.")
|
||||||
|
|
||||||
|
body = {
|
||||||
|
"appId": app_id
|
||||||
|
}
|
||||||
|
EnterpriseRequest.send_request("DELETE", "/webapp/clean", json=body)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user