imporving for: Automatically saving workflows can result in overwriting changes made by others #3610 #32573
caoping6
started this conversation in
Suggestion
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
existing discussion:
solution:

I chose Redis distributed locks and added buttons for acquiring/releasing locks on the page where workflows are edited
add api:
`
@console_ns.route("/apps/uuid:app_id/workflows/draft/lock")
class WorkflowLockApi(Resource):
@console_ns.doc("get_workflow_lock_status")
@console_ns.doc(description="Get workflow edit lock status")
@console_ns.doc(params={"app_id": "Application ID"})
@console_ns.response(200, "Lock status retrieved successfully")
@setup_required
@login_required
@account_initialization_required
@get_app_model(mode=[AppMode.ADVANCED_CHAT, AppMode.WORKFLOW])
def get(self, app_model: App):
"""
Get workflow edit lock status
"""
current_user, _ = current_account_with_tenant()
workflow_service = WorkflowService()
lock_status = workflow_service.get_workflow_lock_status(app_model)
lock_status["is_locked_by_me"] = workflow_service.check_workflow_lock(app_model, current_user)
return lock_status
`
2. Additional context or comments
No response
3. Can you help us with this feature?
Beta Was this translation helpful? Give feedback.
All reactions