[yast-commit] <rest-service> backgroud_patches_bnc550934 : code cleanup
ref: refs/heads/backgroud_patches_bnc550934 commit 5ffe9e7dd9d0b0998a80e3e20915d9f1896d3fd1 Author: Ladislav Slezak <lslezak@novell.com> Date: Thu Dec 17 08:51:37 2009 +0100 code cleanup --- plugins/status/lib/status.rb | 2 +- webservice/lib/background_manager.rb | 15 ++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/plugins/status/lib/status.rb b/plugins/status/lib/status.rb index 6d94bb2..6cae118 100644 --- a/plugins/status/lib/status.rb +++ b/plugins/status/lib/status.rb @@ -155,7 +155,7 @@ class Status end def create_unique_key(start, stop, data) - 'status_' + start.to_i.to_s + '_' + stop.to_i.to_s + '_' + data.to_s + "status_#{start}_#{stop}_#{data}" end # this is a wrapper to collect_data diff --git a/webservice/lib/background_manager.rb b/webservice/lib/background_manager.rb index 2607e86..bc22281 100644 --- a/webservice/lib/background_manager.rb +++ b/webservice/lib/background_manager.rb @@ -27,20 +27,16 @@ class BackgroundManager # is the process running? def process_running?(id) - ret = false @mutex.synchronize do - ret = @running.has_key? id + @running.has_key? id end - ret end # is the process finished? def process_finished?(id) - ret = false @mutex.synchronize do - ret = @done.has_key? id + @done.has_key? id end - ret end # remove the progress status and remember the real final value @@ -54,21 +50,18 @@ class BackgroundManager # get the current progress # returns a copy, use update_progress() for updating the progress def get_progress(id) - ret = nil @mutex.synchronize do ret = @running[id] ret = ret.dup unless ret.nil? + ret end - ret end # get the final value, the value is removed from the internal structure def get_value(id) - ret = nil @mutex.synchronize do - ret = @done.delete id + @done.delete id end - ret end # update the progress -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
Ladislav Slezak