hydra-queue-runner: Detect changes to the scheduling shares

This commit is contained in:
Eelco Dolstra
2015-08-12 13:17:56 +02:00
parent 2e3899ed27
commit d4759c1da2
4 changed files with 52 additions and 9 deletions

View File

@ -64,6 +64,7 @@ create table Jobsets (
checkInterval integer not null default 300, -- minimum time in seconds between polls (0 = disable polling)
schedulingShares integer not null default 100,
fetchErrorMsg text,
check schedulingShares > 0,
primary key (project, name),
foreign key (project) references Projects(name) on delete cascade on update cascade
#ifdef SQLITE
@ -72,6 +73,14 @@ create table Jobsets (
#endif
);
#ifdef POSTGRESQL
create function notifyJobsetSharesChanged() returns trigger as 'begin notify jobset_shares_changed; return null; end;' language plpgsql;
create trigger JobsetSharesChanged after update on Jobsets for each row
when (old.schedulingShares != new.schedulingShares) execute procedure notifyJobsetSharesChanged();
#endif
create table JobsetRenames (
project text not null,