From ac6308661a688abcfb4e43a4f0081b656655f5ba Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Thu, 25 Nov 2021 20:16:23 +0000 Subject: [PATCH] do not accept job queue entries for demo hosting --- Changes | 6 ++++++ lib/App/Netdisco/JobQueue/PostgreSQL.pm | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 31a784a4..9ff2c3ab 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,9 @@ +2.051005 - 2021-11-25 + + [ENHANCEMENTS] + + * do not accept any job queue entries for demo hosting + 2.051004 - 2021-11-25 [BUG FIXES] diff --git a/lib/App/Netdisco/JobQueue/PostgreSQL.pm b/lib/App/Netdisco/JobQueue/PostgreSQL.pm index 7dc58bef..4c9f4b66 100644 --- a/lib/App/Netdisco/JobQueue/PostgreSQL.pm +++ b/lib/App/Netdisco/JobQueue/PostgreSQL.pm @@ -321,8 +321,11 @@ sub jq_userlog { sub jq_insert { my $jobs = shift; $jobs = [$jobs] if ref [] ne ref $jobs; - my $happy = false; + # bit of a hack for heroku hosting to avoid DB overload + return true if setting('defanged_admin') eq 'false_admin'; + + my $happy = false; try { schema('netdisco')->txn_do(sub { schema('netdisco')->resultset('Admin')->populate([