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
5ea374fe
Commit
5ea374fe
authored
Jun 28, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Guarantee the earliest key
parent
07e79989
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
lib/gitlab/background_migration/update_authorized_keys_file_since.rb
...background_migration/update_authorized_keys_file_since.rb
+1
-1
spec/lib/gitlab/background_migration/update_authorized_keys_file_since_spec.rb
...round_migration/update_authorized_keys_file_since_spec.rb
+1
-0
No files found.
lib/gitlab/background_migration/update_authorized_keys_file_since.rb
View file @
5ea374fe
...
...
@@ -20,7 +20,7 @@ module Gitlab
end
def
add_keys_since
(
cutoff_datetime
)
start_key
=
Key
.
select
(
:id
).
where
(
"created_at >= ?"
,
cutoff_datetime
).
take
start_key
=
Key
.
select
(
:id
).
where
(
"created_at >= ?"
,
cutoff_datetime
).
order
(
'id ASC'
).
take
if
start_key
batch_add_keys_in_db_starting_from
(
start_key
.
id
)
end
...
...
spec/lib/gitlab/background_migration/update_authorized_keys_file_since_spec.rb
View file @
5ea374fe
...
...
@@ -49,6 +49,7 @@ describe Gitlab::BackgroundMigration::UpdateAuthorizedKeysFileSince do
before
do
Timecop
.
travel
1
.
day
.
from_now
@key
=
create
(
:key
)
create
(
:key
)
# other key
end
it
'calls batch_add_keys_in_db_starting_from with the start key ID'
do
...
...
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