Create route for externally-managed triggers that run only once#128
Conversation
b44be52 to
78d57ed
Compare
a7c8451 to
3aba153
Compare
hunterrees
left a comment
There was a problem hiding this comment.
I'm not ready to approve yet, but if we keep this approach I don't think we'll need changes. I'd like to discuss the option I outlined of not creating a new table before we proceed.
3df4be0 to
8449c7c
Compare
|
You should probably update the description, since it doesn't involve creating a database anymore. |
8449c7c to
20b65a3
Compare
6fbbb6e to
de07e18
Compare
4d096b9 to
85d8814
Compare
tmccombs
left a comment
There was a problem hiding this comment.
Almost there.
But you need to actually check the value of your EXISTS query, and your test isn't actually testing that we don't insert a duplicate record.
145235f to
6fe78d7
Compare
6fe78d7 to
f6eee6b
Compare
f6eee6b to
381768b
Compare
| private final val prefixForOneTimeJobs = "ONE_TIME_" | ||
| final def oneTimeFireInstanceId(id: Long): String = prefixForOneTimeJobs + id.toString() | ||
| private final val triggerKeyGroup = "ONE_TIME_JOB" | ||
| final def oneTimeTriggerKey(fireInstanceId: Long): TriggerKey = TriggerKey(fireInstanceId.toString, triggerKeyGroup) |
There was a problem hiding this comment.
Do we really want to use the instance id for the trigger name? Would it be better to use the job name or something?
eb219e7 to
ea1115d
Compare
There was a problem hiding this comment.
We'll need to manually apply this patch everywhere unfortunately (we probably don't care as much about dev/staging though)
There was a problem hiding this comment.
I wonder if we should flatten these patches, so that there is just a single sql file you run to set up the tables (but keep the patches files so you can migrate existing DBs?)
There was a problem hiding this comment.
I think thats a good idea, but it is out of scope for this PR
446705d to
c5f711c
Compare
c5f711c to
b6b148f
Compare

This creates the
/triggers/:group/:name/onetime/:idroute to allow for one-time triggers to be created that don't run on a cron schedule. One-time triggers a different from simple triggers, because they require an ID provided to the route, allowing them to be managed outside of piezo