----- "Jan Provaznik" <[email protected]> wrote:

> On 10/13/2010 10:43 PM, Jason Guiditta wrote:
> > https://bugzilla.redhat.com/show_bug.cgi?id=641484
> >
> > The queue was never being processed if there were builds already
> > in progress.
> > ---
> >   src/image_builder_service/image_builder_service |    4 ++--
> >   1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/image_builder_service/image_builder_service
> b/src/image_builder_service/image_builder_service
> > index 8093143..a77a2ae 100755
> > --- a/src/image_builder_service/image_builder_service
> > +++ b/src/image_builder_service/image_builder_service
> > @@ -107,7 +107,7 @@ class ImageBuilderService
> >         @log.debug "All Incomplete Builds: " + cur_builds.size.to_s
> >         @log.debug "========================================"
> >       end
> > -    cur_builds.size>  queue.size ? find_orphaned(cur_builds) :
> > +    find_orphaned(cur_builds) if cur_builds.size>  queue.size
> >       queue.each {|t|
> >         build(t)
> >       }
> > @@ -141,7 +141,7 @@ class ImageBuilderService
> >
> >     def find_orphaned(cur_builds)
> >       cur_builds.delete_if do |b|
> > -      @activebuilds.size == 0 ? break :
> > +      break if @activebuilds.size == 0
> >         @activebuilds.each do |ab|
> >           b.build_id.eql?(ab[:build_id])
> >         end
> 
> ACK

Also ACK with a few comments:

1) Maybe instead of @activebuilds.size == 0 we could write just 
@activebuilds.empty? (it's faster and more intuitive)
2) Also I see that most of you are using method 'size' extensively, but maybe 
you could consider using method 'length' instead. Ruby isn't strongly type 
language and using size on integer can give u accidentally the same results.
You can read more about it at Floehoppers blog: 
http://blog.floehopper.org/articles/2007/08/07/why-array-length-is-better-than-array-size

Cherrios, Ladislav
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to