avoid message re-insertion, extend test mode, schema and docs updates

include new table in main schema, since this plugin is part of Koji itself

clean up and expand the docs for this plugin

refactor query_from_db() into handle_db_msgs()
* fix lock error cases
* only delete messages from queue if we successfully send them
* handle test_mode

allow test_mode to exercise db queue via test_mode_fail setting
This commit is contained in:
Mike McLean 2020-09-24 15:54:27 -04:00 committed by Tomas Kopecek
parent aff74c4b3a
commit 4ddc48e72a
4 changed files with 113 additions and 47 deletions

View file

@ -937,4 +937,15 @@ CREATE TABLE win_archives (
flags TEXT
) WITHOUT OIDS;
-- Message queue for the protonmsg plugin
CREATE TABLE proton_queue (
id SERIAL PRIMARY KEY,
created_ts TIMESTAMPTZ,
address TEXT NOT NULL,
props JSON NOT NULL,
body JSON NOT NULL
) WITHOUT OIDS;
COMMIT WORK;