Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8a92a1bb
Commit
8a92a1bb
authored
Oct 29, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create sidetiq ldap sync worker.
parent
80640413
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
app/workers/ldap_sync_worker.rb
app/workers/ldap_sync_worker.rb
+19
-0
No files found.
app/workers/ldap_sync_worker.rb
0 → 100644
View file @
8a92a1bb
class
LdapSyncWorker
include
Sidekiq
::
Worker
include
Sidetiq
::
Schedulable
if
Gitlab
.
config
.
ldap
.
enabled
HOUR
=
Gitlab
.
config
.
ldap
.
servers
.
values
.
first
[
'schedule_sync_hour'
]
MINUTE
=
Gitlab
.
config
.
ldap
.
servers
.
values
.
first
[
'schedule_sync_minute'
]
recurrence
{
daily
.
hour_of_day
(
HOUR
).
minute_of_hour
(
MINUTE
)
}
end
def
perform
Rails
.
logger
.
info
"Performing daily LDAP sync task."
User
.
ldap
.
find_each
(
batch_size:
100
).
each
do
|
ldap_user
|
Rails
.
logger
.
debug
"Syncing user
#{
ldap_user
.
username
}
,
#{
ldap_user
.
email
}
"
Gitlab
::
LDAP
::
Access
.
allowed?
(
ldap_user
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment