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
7192f86e
Commit
7192f86e
authored
Oct 26, 2012
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Satellite#lock
parent
700a784b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
lib/gitlab/satellite/satellite.rb
lib/gitlab/satellite/satellite.rb
+6
-2
No files found.
lib/gitlab/satellite/satellite.rb
View file @
7192f86e
...
@@ -25,16 +25,20 @@ module Gitlab
...
@@ -25,16 +25,20 @@ module Gitlab
File
.
exists?
path
File
.
exists?
path
end
end
# Locks the satellite and yields
# * Locks the satellite
# * Changes the current directory to the satellite's working dir
# * Yields
def
lock
def
lock
raise
"Satellite doesn't exist"
unless
exists?
raise
"Satellite doesn't exist"
unless
exists?
File
.
open
(
lock_file
,
"w+"
)
do
|
f
|
File
.
open
(
lock_file
,
"w+"
)
do
|
f
|
f
.
flock
(
File
::
LOCK_EX
)
f
.
flock
(
File
::
LOCK_EX
)
Dir
.
chdir
(
path
)
do
return
yield
return
yield
end
end
end
end
end
def
lock_file
def
lock_file
Rails
.
root
.
join
(
"tmp"
,
"
#{
project
.
path
}
.lock"
)
Rails
.
root
.
join
(
"tmp"
,
"
#{
project
.
path
}
.lock"
)
...
...
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