New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1612 handle concurrency of rugged and cli git #1677
base: staging
Are you sure you want to change the base?
Conversation
end | ||
|
||
# change a single file and commit the change | ||
def commit_file_without_lock(userinfo, file_contents, target_path, message, &block) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [85/80]
Method has too many lines. [22/10]
I'll ignore the |
end | ||
|
||
# change a single file and commit the change | ||
def commit_file_without_lock(userinfo, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method has too many lines. [26/10]
@@ -26,6 +26,12 @@ def initialize(repo_path, key_id, refs) | |||
end | |||
|
|||
def exec | |||
Semaphore.exclusively("action:#{@repo_name}") do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please find a way to only write "action:"
once. Maybe put it into a constant or a class method of GitRepository
.
And please use git
instead of action
(we will have many locks with different types and all of them are some kind of action)
55e3375
to
b33e751
Compare
I think you could incorporate it as well in lib/git_repository/cloning.rb:98 ( A mirror repository should not be synchronised while another operation is executed on the repository, but a lock shouldn't hurt in this case. |
See spec/lib/semaphore_spec.rb for a test that uses fork_break |
b33e751
to
2e4d514
Compare
end | ||
|
||
# change a single file and commit the change | ||
def commit_file_without_lock(userinfo, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method has too many lines. [26/10]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not related to the PR, so don't mind.
2e4d514
to
bda5480
Compare
Well, except for the yet to be written tests: 👍 |
This should fix #1612