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
0
Merge Requests
0
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
iv
gitlab-ce
Commits
ccc01b36
Commit
ccc01b36
authored
Mar 24, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small code cleanup.
parent
e7bbd85b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
17 deletions
+8
-17
app/services/archive_repository_service.rb
app/services/archive_repository_service.rb
+4
-9
app/workers/repository_archive_worker.rb
app/workers/repository_archive_worker.rb
+4
-8
No files found.
app/services/archive_repository_service.rb
View file @
ccc01b36
...
@@ -3,7 +3,7 @@ class ArchiveRepositoryService
...
@@ -3,7 +3,7 @@ class ArchiveRepositoryService
def
initialize
(
project
,
ref
,
format
)
def
initialize
(
project
,
ref
,
format
)
format
||=
'tar.gz'
format
||=
'tar.gz'
@project
,
@ref
,
@format
=
project
,
ref
,
format
@project
,
@ref
,
@format
=
project
,
ref
,
format
.
downcase
end
end
def
execute
def
execute
...
@@ -28,16 +28,12 @@ class ArchiveRepositoryService
...
@@ -28,16 +28,12 @@ class ArchiveRepositoryService
Gitlab
.
config
.
gitlab
.
repository_downloads_path
Gitlab
.
config
.
gitlab
.
repository_downloads_path
end
end
def
archive_args
@archive_args
||=
[
ref
,
storage_path
,
format
.
downcase
]
end
def
file_path
def
file_path
@file_path
||=
project
.
repository
.
archive_file_path
(
*
archive_args
)
@file_path
||=
project
.
repository
.
archive_file_path
(
ref
,
storage_path
,
format
)
end
end
def
pid_file_path
def
pid_file_path
@pid_file_path
||=
project
.
repository
.
archive_pid_file_path
(
*
archive_args
)
@pid_file_path
||=
project
.
repository
.
archive_pid_file_path
(
ref
,
storage_path
,
format
)
end
end
def
archived?
def
archived?
...
@@ -48,8 +44,7 @@ class ArchiveRepositoryService
...
@@ -48,8 +44,7 @@ class ArchiveRepositoryService
File
.
exist?
(
pid_file_path
)
File
.
exist?
(
pid_file_path
)
end
end
def
wait_until_archived
def
wait_until_archived
(
timeout
=
5.0
)
timeout
=
5.0
t1
=
Time
.
now
t1
=
Time
.
now
begin
begin
...
...
app/workers/repository_archive_worker.rb
View file @
ccc01b36
...
@@ -7,7 +7,7 @@ class RepositoryArchiveWorker
...
@@ -7,7 +7,7 @@ class RepositoryArchiveWorker
def
perform
(
project_id
,
ref
,
format
)
def
perform
(
project_id
,
ref
,
format
)
@project
=
Project
.
find
(
project_id
)
@project
=
Project
.
find
(
project_id
)
@ref
,
@format
=
ref
,
format
@ref
,
@format
=
ref
,
format
.
downcase
repository
=
project
.
repository
repository
=
project
.
repository
...
@@ -15,7 +15,7 @@ class RepositoryArchiveWorker
...
@@ -15,7 +15,7 @@ class RepositoryArchiveWorker
return
if
archived?
||
archiving?
return
if
archived?
||
archiving?
repository
.
archive_repo
(
*
archive_args
)
repository
.
archive_repo
(
ref
,
storage_path
,
format
)
end
end
private
private
...
@@ -24,16 +24,12 @@ class RepositoryArchiveWorker
...
@@ -24,16 +24,12 @@ class RepositoryArchiveWorker
Gitlab
.
config
.
gitlab
.
repository_downloads_path
Gitlab
.
config
.
gitlab
.
repository_downloads_path
end
end
def
archive_args
@archive_args
||=
[
ref
,
storage_path
,
format
.
downcase
]
end
def
file_path
def
file_path
@file_path
||=
project
.
repository
.
archive_file_path
(
*
archive_args
)
@file_path
||=
project
.
repository
.
archive_file_path
(
ref
,
storage_path
,
format
)
end
end
def
pid_file_path
def
pid_file_path
@pid_file_path
||=
project
.
repository
.
archive_pid_file_path
(
*
archive_args
)
@pid_file_path
||=
project
.
repository
.
archive_pid_file_path
(
ref
,
storage_path
,
format
)
end
end
def
archived?
def
archived?
...
...
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