From: Eric Bollengier Date: Sun, 4 Feb 2007 21:28:57 +0000 (+0000) Subject: ebl fix batch mode X-Git-Tag: Release-2.2.0~1107 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bb2e278290fa0fc777d021638956cf7f46e2e68c;p=bacula%2Fbacula ebl fix batch mode git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4100 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/gui/brestore/brestore.pl b/gui/brestore/brestore.pl index e327e6794c..64bfb8692a 100755 --- a/gui/brestore/brestore.pl +++ b/gui/brestore/brestore.pl @@ -2301,6 +2301,17 @@ sub get_pathid return join(',', map { $_->[0] } @$result); } + +sub update_cache +{ + my ($self) = @_; + + my $query = "SELECT JobId from Job WHERE JobId NOT IN (SELECT JobId FROM brestore_knownjobid) order by JobId"; + my $jobs = $self->dbh_selectall_arrayref($query); + + $self->update_brestore_table(map { $_->[0] } @$jobs); +} + sub get_root { my ($self, $dir) = @_; @@ -3215,33 +3226,6 @@ sub list_client 1; -################################################################ - -package Batch; -use base qw/DlgResto/; - -sub new -{ - my ($class, $conf) = @_; - my $self = bless {info => $conf}, $class; - - $self->{dbh} = $conf->{dbh}; - - return $self; -} - -sub update_cache -{ - my ($self) = @_; - - my $query = "SELECT JobId from Job WHERE JobId NOT IN (SELECT JobId FROM brestore_knownjobid) order by JobId"; - my $jobs = $self->dbh_selectall_arrayref($query); - - $self->{bvfs}->update_brestore_table(map { $_->[0] } @$jobs); -} - -1; - package main; use Getopt::Long ; @@ -3267,10 +3251,9 @@ if (! -f $file_conf) { } if ($batch_mod) { - my $b = new Batch($p); + my $vfs = new Bvfs(conf => $p); if ($p->connect_db()) { - $b->set_dbh($p->{dbh}); - $b->update_cache(); + $vfs->update_cache(); } exit (0); }