[vhffs-dev] [1547] Replaced all ${%somehash} occurences to $somehash (with

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1547
Author:   guillaumito
Date:     2010-03-05 11:35:46 +0100 (Fri, 05 Mar 2010)
Log Message:
-----------
Replaced all ${%somehash} occurences to $somehash (with
somehash = jobs or fd2jobs).

Modified Paths:
--------------
    trunk/vhffs-robots/src/cron_scheduler.pl

Modified: trunk/vhffs-robots/src/cron_scheduler.pl
===================================================================
--- trunk/vhffs-robots/src/cron_scheduler.pl	2010-03-03 22:14:09 UTC (rev 1546)
+++ trunk/vhffs-robots/src/cron_scheduler.pl	2010-03-05 10:35:46 UTC (rev 1547)
@@ -77,7 +77,7 @@
 		# new jobs ?
 		my $crons = Vhffs::Robots::Cron::get_runnable_jobs( $vhffs );
 		foreach my $c ( @{$crons} )  {
-			if( exists ${%jobs}{ $c->get_cron_id } )  {
+			if( exists $jobs{ $c->get_cron_id } )  {
 				print scalar localtime().'    ! '.$c->get_cron_id.' '.$c->get_cronpath."\n";
 			}
 			else {
@@ -96,7 +96,7 @@
 	}
 
 	foreach ( keys %jobs )  {
-		my $job = ${%jobs}{$_};
+		my $job = $jobs{$_};
 		if( $job->{'status'} == STATUS_CREATED )  {
 			run_job( $job ) if( time() > $job->{'runat'} );
 		}
@@ -110,7 +110,7 @@
 
 	my ($rh_set) = IO::Select->select($read_set, undef, undef, 1);
 	foreach my $rh (@$rh_set) {
-		my $job = ${%fd2jobs}{$rh->fileno};
+		my $job = $fd2jobs{$rh->fileno};
 		my $cron = $job->{'cron'};
 		my $buf = <$rh>;
 		if($buf) {
@@ -192,22 +192,22 @@
 		return undef;
 	}
 
-	${%jobs}{$cron_id}{'cron'} = $cron;
-	${%jobs}{$cron_id}{'fullpath'} = $fullpath;
-	${%jobs}{$cron_id}{'pid'} = undef;
-	${%jobs}{$cron_id}{'pipe'} = undef;
-	${%jobs}{$cron_id}{'output'} = undef;
-	${%jobs}{$cron_id}{'env'} = '';
-	${%jobs}{$cron_id}{'inheaders'} = 1;
-	${%jobs}{$cron_id}{'createdat'} = time();
-	${%jobs}{$cron_id}{'runat'} = ${%jobs}{$cron_id}{'createdat'} + int(rand 4) +2;
-	${%jobs}{$cron_id}{'startedat'} = undef;
-	${%jobs}{$cron_id}{'status'} = STATUS_CREATED;
-	$cron->quick_set_nextrundate( ${%jobs}{$cron_id}{'runat'} );  # so that we know when the process will/has be/been started in nextrundate
+	$jobs{$cron_id}{'cron'} = $cron;
+	$jobs{$cron_id}{'fullpath'} = $fullpath;
+	$jobs{$cron_id}{'pid'} = undef;
+	$jobs{$cron_id}{'pipe'} = undef;
+	$jobs{$cron_id}{'output'} = undef;
+	$jobs{$cron_id}{'env'} = '';
+	$jobs{$cron_id}{'inheaders'} = 1;
+	$jobs{$cron_id}{'createdat'} = time();
+	$jobs{$cron_id}{'runat'} = $jobs{$cron_id}{'createdat'} + int(rand 4) +2;
+	$jobs{$cron_id}{'startedat'} = undef;
+	$jobs{$cron_id}{'status'} = STATUS_CREATED;
+	$cron->quick_set_nextrundate( $jobs{$cron_id}{'runat'} );  # so that we know when the process will/has be/been started in nextrundate
 	$cron->quick_inc_running();
 
 	print scalar localtime().'    + '.$cron_id.' '.$cron->get_cronpath."\n";
-	return ${%jobs}{$cron_id};
+	return $jobs{$cron_id};
 }
 
 
@@ -254,11 +254,11 @@
 		# I am the parent
 		close $son;
 
-		${%jobs}{$cron_id}{'pid'} = $pid;
-		${%jobs}{$cron_id}{'pipe'} = $par;
-		${%jobs}{$cron_id}{'startedat'} = time();
-		${%jobs}{$cron_id}{'status'} = STATUS_RUNNING;
-		${%fd2jobs}{$par->fileno} = ${%jobs}{$cron_id};
+		$jobs{$cron_id}{'pid'} = $pid;
+		$jobs{$cron_id}{'pipe'} = $par;
+		$jobs{$cron_id}{'startedat'} = time();
+		$jobs{$cron_id}{'status'} = STATUS_RUNNING;
+		$fd2jobs{$par->fileno} = $jobs{$cron_id};
 		$read_set->add($par);
 		return 0;
 
@@ -312,11 +312,11 @@
 	my $cron_id = $cron->get_cron_id;
 
 	print scalar localtime().'    - '.$cron->get_cron_id.' '.$cron->get_cronpath."\n";
-	delete ${%jobs}{$cron_id};
+	delete $jobs{$cron_id};
 
 	my $pipe = $job->{'pipe'};
 	if( defined $pipe )  {
-		delete ${%fd2jobs}{ $pipe->fileno };
+		delete $fd2jobs{ $pipe->fileno };
 		$read_set->remove($pipe);
 		close($pipe);
 	}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/