X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/c6dd542b51ae9549ad42a54f9023b905412bbab9..2ecfde54bd40a15f430010faa28ec81383e4eec6:/scripts/task_server.pl diff --git a/scripts/task_server.pl b/scripts/task_server.pl index 1bcb719c9..f22ce13b0 100755 --- a/scripts/task_server.pl +++ b/scripts/task_server.pl @@ -32,6 +32,7 @@ use File::Spec; use List::Util qw(first); use POSIX qw(setuid setgid); use SL::Auth; +use SL::DBUpgrade2; use SL::DB::AuthClient; use SL::DB::BackgroundJob; use SL::BackgroundJob::ALL; @@ -63,7 +64,6 @@ sub initialize_kivitendo { package main; - Form::disconnect_standard_dbh; $::lxdebug = LXDebug->new; $::locale = Locale->new($::lx_office_conf{system}->{language}); $::form = Form->new; @@ -93,8 +93,7 @@ sub initialize_kivitendo { } sub cleanup_kivitendo { - eval { SL::DB::Auth->new->db->dbh->rollback; }; - eval { SL::DB::BackgroundJob->new->db->dbh->rollback; }; + eval { SL::DB->client->dbh->rollback; }; $::auth->save_session; $::auth->expire_sessions; @@ -107,9 +106,10 @@ sub cleanup_kivitendo { } sub clean_before_sleeping { - Form::disconnect_standard_dbh; SL::DBConnect::Cache->disconnect_all_and_clear; SL::DB->db_cache->clear; + + File::Temp::cleanup(); } sub drop_privileges { @@ -210,6 +210,18 @@ EOT exit 2; } + initialize_kivitendo(); + + my $dbupdater_auth = SL::DBUpgrade2->new(form => $::form, auth => 1)->parse_dbupdate_controls; + if ($dbupdater_auth->unapplied_upgrade_scripts($::auth->dbconnect)) { + print STDERR <show_backtrace(); - die <