Index: /trunk/ippScripts/scripts/automate_stacks.pl
===================================================================
--- /trunk/ippScripts/scripts/automate_stacks.pl	(revision 27710)
+++ /trunk/ippScripts/scripts/automate_stacks.pl	(revision 27711)
@@ -67,4 +67,5 @@
     'logfile=s'            => \$logfile,
     'verbose'              => \$verbose,
+    'debug'                => \$debug,
     'isburning'            => \$isburning,
     'force_stack_count'    => \$force_stack_count,
@@ -263,4 +264,7 @@
     $metadata_out{nsState} = 'STACKING';
     &execute_stacks($date);
+    if ($metadata_out{nsState} == 'QUEUESTACKING') {
+	$metadata_out{nsState} = 'STACKING_POSSIBLE_ERROR';
+    }
     return_metadata($date);
     exit(0);
@@ -681,21 +685,32 @@
                 my ($Nexposures,$NprocChips,$NprocWarps,$Nalready) = pre_stack_queue($date,$target,$filter);
                 if ((!defined($force_stack_count))&&($NprocChips != $NprocWarps)) { # This makes me sad. :(
-                    # print STDERR "execute_stacks: Target $target on $date is not fully processed. ($NprocChips $NprocWarps)\n";
+		    if ($debug == 1) {
+			print STDERR "execute_stacks: Target $target on $date is not fully processed. ($NprocChips $NprocWarps)\n";
+		    }
                     $metadata_out{nsState} = 'FORCETOWARP';
                     next;
                 }
                 if ($Nexposures == 0) {
-                    # print STDERR "execute_stacks: Target $target in filter $filter on $date has no exposures.\n";
+		    if ($debug == 1) {
+			print STDERR "execute_stacks: Target $target in filter $filter on $date has no exposures.\n";
+		    }
                     next;
                 }
                 if ($Nalready != 0) {
-                    # print STDERR "execute_stacks: Not queueing $target in filter $filter on $date due to already existing stacks.\n";
+		    if ($debug == 1) {
+			print STDERR "execute_stacks: Not queueing $target in filter $filter on $date due to already existing stacks.\n";
+		    }
+		    unless ($metadata_out{nsState} eq 'FORCETOWARP') {
+			$metadata_out{nsState} = 'STACKING';
+		    }
                     next;
                 }
-                unless ($metadata_out{nsState} eq 'FORCETOWARP') {
+                unless (($metadata_out{nsState} eq 'FORCETOWARP')||($metadata_out{nsState} eq 'STACKING')) {
                     $metadata_out{nsState} = 'QUEUESTACKS';
                 }
                 unless(defined($pretend)) {
-                    # print STDERR "execute_stacks: Target $target in filter $filter on $date has exposures and will be queued.\n";
+		    if ($debug == 1) {
+			print STDERR "execute_stacks: Target $target in filter $filter on $date has exposures and will be queued.\n";
+		    }
                     stack_queue($date,$target,$filter);
                 }
Index: /trunk/ippTasks/nightly_stacks.pro
===================================================================
--- /trunk/ippTasks/nightly_stacks.pro	(revision 27710)
+++ /trunk/ippTasks/nightly_stacks.pro	(revision 27711)
@@ -370,5 +370,5 @@
   periods         -poll $LOADPOLL
   periods         -exec $LOADEXEC
-  periods         -timeout 30
+  periods         -timeout 120
   npending        1
 
@@ -424,5 +424,5 @@
   periods         -poll $LOADPOLL
   periods         -exec $LOADEXEC
-  periods         -timeout 30
+  periods         -timeout 120
   npending        1
 
