D. Berge
d9a6c77d0c
Update API description
2023-10-23 19:25:48 +02:00
D. Berge
b5aafe42ad
Add YAML support to events GET endpoint
2023-10-23 19:24:03 +02:00
D. Berge
025f3f774d
Add YAML and CSV support to project configuration GET endpoint
2023-10-23 19:22:50 +02:00
D. Berge
f26e746c2b
Add flatEntries utility
2023-10-23 18:58:37 +02:00
D. Berge
39eaf17121
Update API description
2023-10-23 18:48:05 +02:00
D. Berge
1bb06938b1
Add CSV export handler to main event log endpoint.
...
Closes #245 .
2023-10-23 17:28:30 +02:00
D. Berge
851369a0b4
Invalidate planner endpoint cache when setting remarks
2023-10-23 14:58:41 +02:00
D. Berge
5065d62443
Update planner endpoint documentation
2023-10-23 14:57:27 +02:00
D. Berge
2d1e1e9532
Modify return payload of planner endpoint.
...
Previous:
[
{ sequence: …},
{ sequence: …},
…
]
Current:
{
remarks: "…",
sequences: [
{ sequence: …},
{ sequence: …},
…
]
}
2023-10-23 14:53:32 +02:00
D. Berge
051049581a
Merge branch '278-rewrite-events-queue' into 'devel'
...
Resolve "Rewrite events queue"
Closes #278
See merge request wgp/dougal/software!46
2023-10-17 10:28:21 +00:00
D. Berge
da5ae18b0b
Merge branch '269-support-requesting-a-partial-update-from-the-events-log-endpoint' into devel
2023-10-17 12:27:31 +02:00
D. Berge
ac9353c101
Add database upgrade file 31.
2023-10-17 12:27:06 +02:00
D. Berge
c4c5c44bf1
Add comment
2023-10-17 12:20:19 +02:00
D. Berge
d3659ebf02
Merge branch '269-support-requesting-a-partial-update-from-the-events-log-endpoint' into 'devel'
...
Resolve "Support requesting a partial update from the events log endpoint"
Closes #269
See merge request wgp/dougal/software!47
2023-10-17 10:18:41 +00:00
D. Berge
6b5070e634
Add event changes API endpoint description
2023-10-17 12:15:41 +02:00
D. Berge
09ff96ceee
Add events change API endpoint
2023-10-17 11:15:36 +02:00
D. Berge
f231acf109
Add events change middleware
2023-10-17 11:15:06 +02:00
D. Berge
e576e1662c
Add library function returning event changes after given epoch
2023-10-17 11:13:58 +02:00
D. Berge
6a21ddd1cd
Rewrite events listener and handlers.
...
The events listener now uses a proper self-consuming queue and
the event handlers have been rewritten accordingly.
The way this works is that running init() on the handlers
library instantiates the handlers and returns two higher-order
functions, prepare() and despatch(). A call to the latter of
these is appended to the queue with each new incoming event.
The handlers have access to a context object (ctx) which may be
used to persist data between calls and/or exchange data between
handlers. This is used notably to give the handlers access to
project configurations, which are themselves refreshed by a
project configuration change handler (DetectProjectConfigurationChange).
2023-10-14 20:53:42 +02:00
D. Berge
c1e35b2459
Cache project configuration details.
...
This avoids requesting the project configurations on every single
incoming message. A listener refreshes the data on configuration
changes.
2023-10-14 20:11:18 +02:00
D. Berge
eee2a96029
Modify logging statements
2023-10-14 20:10:46 +02:00
D. Berge
6f5e5a4d20
Fix bug for shortcut when there is only one candidate project
2023-10-14 20:09:07 +02:00
D. Berge
9e73cb7e00
Clean up on SIGINT, SIGHUP signals
2023-10-14 20:07:19 +02:00
D. Berge
d7ab4eec7c
Run some tasks periodically from the main process.
...
This reduces reliance on crontab jobs.
2023-10-14 20:06:38 +02:00
D. Berge
cdd96a4bc7
Don't bother trying to kill the child process on exit.
...
As the exit signal handler does not allow asynchronous tasks and
besides, killing the parent should kill its children too.
2023-10-14 20:02:54 +02:00
D. Berge
39a21766b6
Exit on start up errors
2023-10-14 20:02:04 +02:00
D. Berge
0e33c18b5c
Replace console.log() with debug library calls
2023-10-14 19:57:57 +02:00
D. Berge
7f411ac7dd
Add queue libraries.
...
A basic queue implementation and one that consumes its items
automatically until empty.
2023-10-14 19:56:56 +02:00
D. Berge
ed1da11c9d
Add helper function to purge notifications
2023-10-14 19:54:34 +02:00
D. Berge
66ec28dd83
Refactor DB notifications listener to support large payloads.
...
The listener will automatically retrieve the full payload
before passing it on to event handlers.
2023-10-14 18:33:41 +02:00
D. Berge
b928d96774
Add database upgrade file 30.
2023-10-14 18:29:28 +02:00
D. Berge
73335f9c1e
Merge branch '136-add-line-change-time-log-pseudoevent' into 'devel'
...
Resolve "Add line change time log pseudoevent"
Closes #136
See merge request wgp/dougal/software!45
2023-10-04 12:50:49 +00:00
D. Berge
7b6b81dbc5
Add more debugging statements
2023-10-04 14:50:12 +02:00
D. Berge
2e11c574c2
Throw rather than return.
...
Otherwise the finally {} block won't run.
2023-10-04 14:49:35 +02:00
D. Berge
d07565807c
Do not retry immediately
2023-10-04 14:49:09 +02:00
D. Berge
6eccbf215a
There should be no need to await.
...
That is because the queue handler will, in theory, only ever
process one event at a time.
v2023.39.1
2023-09-30 21:29:15 +02:00
D. Berge
8abc05f04e
Remove dead code
2023-09-30 21:29:15 +02:00
D. Berge
8f587467f9
Add comment
2023-09-30 21:29:15 +02:00
D. Berge
3d7a91c7ff
Rewrite ReportLineChangeTime
2023-09-30 21:29:15 +02:00
D. Berge
3fd408074c
Support passing array in opts.sequences to event.list()
2023-09-30 21:29:15 +02:00
D. Berge
f71cbd8f51
Add unique utility function
2023-09-30 21:29:15 +02:00
D. Berge
915df8ac16
Add handler for creation of line change time events
2023-09-30 21:29:15 +02:00
D. Berge
d5ecb08a2d
Allow switching to event entry by time.
...
A ‘Timed’ button is shown when a new (not edited) event is in
the event entry dialogue and the event has sequence and/or
point values. Pressing the button deletes the sequence/point
information and sets the date and time fields to current time.
Fixes #277 .
2023-09-30 21:26:32 +02:00
D. Berge
9388cd4861
Make daily_tasks work with new project configuration
2023-09-30 20:36:46 +02:00
D. Berge
180590b411
Mark events as being automatically generated
2023-09-30 01:42:27 +02:00
D. Berge
4ec37539bf
Add utils to work with Postgres ranges
2023-09-30 01:41:45 +02:00
D. Berge
8755fe01b6
Refactor events.list.
...
The SQL has been simplified and the following changes made:
- The `sequence` argument now can only take one individual
sequence, not a list of sequences.
- A new `sequences` argument is recognised. It takes a list
of sequences (as a string).
- A new `label` argument is recognised. It takes a label
name and returns events containing that label.
- A new `jpq` argument is recognised. It takes a JSONPath
string which is applied to `meta` with jsonb_path_exists(),
returning any events for which the JSON path expression
matches.
2023-09-30 01:37:22 +02:00
D. Berge
0bfe54e0c2
Include the meta attribute when posting events
2023-09-30 01:36:18 +02:00
D. Berge
29bc689b84
Merge branch '276-add-soft-start-event-detection' into 'devel'
...
Resolve "Add soft start event detection"
Closes #276
See merge request wgp/dougal/software!44
2023-09-29 15:02:57 +00:00
D. Berge
65682febc7
Add soft start and full volume events detection
2023-09-29 17:02:03 +02:00