Author: spadkins
Date: Tue Dec  1 17:29:15 2009
New Revision: 13623

Modified:
   p5ee/trunk/App-WorkQueue/lib/App/WorkQueue/Repository.pm

Log:
introduced the base_order_by option to supplement the sort_spec option in order 
to better utilize keys when calling _refill_buffer

Modified: p5ee/trunk/App-WorkQueue/lib/App/WorkQueue/Repository.pm
==============================================================================
--- p5ee/trunk/App-WorkQueue/lib/App/WorkQueue/Repository.pm    (original)
+++ p5ee/trunk/App-WorkQueue/lib/App/WorkQueue/Repository.pm    Tue Dec  1 
17:29:15 2009
@@ -92,7 +92,7 @@
     &App::sub_entry if ($App::trace);
     my ($self) = @_;
     my $context = $self->{context};
-    $context->log({level=>3}, "$self->{name} _heartbeat\n");
+    $context->log({level=>4}, "$self->{name} _heartbeat\n");
     $self->_refresh_queue();
     &App::sub_exit() if ($App::trace);
 }
@@ -101,7 +101,7 @@
     &App::sub_entry if ($App::trace);
     my ($self) = @_;
     my $context = $self->{context};
-    $context->log({level=>3},"$self->{name} _refresh_queue\n");
+    $context->log({level=>4},"$self->{name} _refresh_queue\n");
     $self->_refresh_status_counts();
     $self->_refresh_resource_counts();
     #$self->_maintain_queue_buffers();
@@ -382,11 +382,19 @@
 sub _sort_spec_to_options {
     &App::sub_entry if ($App::trace);
     my ($self, $options) = @_;
+    if ($self->{base_order_by}) {
+        $options->{order_by} = [split(/,/, $self->{base_order_by})];
+    }
     if ($self->{sort_columns}) {
         my $sort_columns = $self->{sort_columns};
         my $direction    = $self->{direction};
         #my $numeric      = $self->{numeric};
-        $options->{order_by} = $sort_columns;
+        if ($options->{order_by}) {
+            push(@{$options->{order_by}}, @$sort_columns);
+        }
+        else {
+            $options->{order_by} = $sort_columns;
+        }
         for (my $i = 0; $i <= $#$sort_columns; $i++) {
             if ($direction->[$i] < 0) {
                 $options->{direction}{$sort_columns->[$i]} = "desc";

Reply via email to