it lives!!!!

This commit is contained in:
JT Smith 2006-02-08 15:46:07 +00:00
parent 00644808a1
commit 8950b951bc
4 changed files with 72 additions and 10 deletions

View file

@ -115,7 +115,8 @@ Returns an integer representing the number of running jobs.
sub countRunningJobs {
my $self = shift;
return scalar(@{$self->{_runningJobs}});
my $runningJobs = $self->{_runningJobs} || [];
return scalar(@{$runningJobs});
}
#-------------------------------------------------------------------

View file

@ -186,16 +186,20 @@ sub new {
return $config{$filename};
} else {
my $json = "";
open(FILE,"<".$webguiPath.'/etc/'.$filename);
while (my $line = <FILE>) {
$json .= $line unless ($line =~ /^\s*#/);
if (open(FILE,"<".$webguiPath.'/etc/'.$filename)) {
while (my $line = <FILE>) {
$json .= $line unless ($line =~ /^\s*#/);
}
close(FILE);
my $conf = jsonToObj($json);
my $self = {_webguiRoot=>$webguiPath, _configFile=>$filename, _config=>$conf};
bless $self, $class;
$config{$filename} = $self unless $noCache;
return $self;
} else {
warn "Cannot open config file: ".$filename;
return undef;
}
close(FILE);
my $conf = jsonToObj($json);
my $self = {_webguiRoot=>$webguiPath, _configFile=>$filename, _config=>$conf};
bless $self, $class;
$config{$filename} = $self unless $noCache;
return $self;
}
}