Commit 871fc894 authored by Michael Kozono's avatar Michael Kozono

Prevent more sync jobs if already pending

parent 3f4c9e98
......@@ -3,9 +3,13 @@ class Groups::LdapsController < Groups::ApplicationController
before_action :authorize_admin_group!
def sync
@group.pending_ldap_sync
LdapGroupSyncWorker.perform_async(@group.id)
if @group.pending_ldap_sync
LdapGroupSyncWorker.perform_async(@group.id)
message = 'The group sync has been scheduled'
else
message = 'The group sync is already scheduled'
end
redirect_to group_group_members_path(@group), notice: 'The group sync has been scheduled'
redirect_to group_group_members_path(@group), notice: message
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment