Revision ded6b9c8
Von Moritz Bunkus vor 10 Tagen hinzugefügt
SL/BackgroundJob/UpdateEmployeeBaseData.pm | ||
---|---|---|
package SL::BackgroundJob::UpdateEmployeeBaseData;
|
||
|
||
# When authentication via HTTP headers is active the regular login
|
||
# routine is skipped. That routine would normally copy values from the
|
||
# auth database to the employee table. This job can be run regularly
|
||
# to copy the same values.
|
||
|
||
use strict;
|
||
use utf8;
|
||
|
||
use parent qw(SL::BackgroundJob::Base);
|
||
|
||
use SL::DB::BackgroundJob;
|
||
use SL::DB::Employee;
|
||
|
||
sub run {
|
||
my ($self, $db_obj, $end_date) = @_;
|
||
|
||
SL::DB::Manager::Employee->update_entries_for_authorized_users;
|
||
|
||
return 1;
|
||
}
|
||
|
||
1;
|
sql/Pg-upgrade2/update_employee_base_data.sql | ||
---|---|---|
-- @tag: update_employee_base_data
|
||
-- @description: Hintergrundjob für regelmäßiges Aktualisieren der Employee-Basisdaten aus der Auth-Tabelle
|
||
-- @depends: release_3_6_0
|
||
INSERT INTO background_jobs (type, package_name, active, cron_spec, next_run_at)
|
||
VALUES ('interval', 'UpdateEmployeeBaseData', true, '*/5 * * * *', current_timestamp);
|
Auch abrufbar als: Unified diff
Auth: regelmäßig Basiswerte in employee aus auth.user aktualisieren
Wenn Authentifizierung via HTTP-Headern aktiv ist, wird die normale
Login-Routine umgangen, in der dieses Update ansonsten gemacht
wird. Also automatisch alle fünf Minuten machen.