···3333}
34343535// StartScheduler starts the scheduler loop, which runs forever
3636+// TODO instead of having a in-memory scheduler, use jetstream:
3737+// 1. Get the message
3838+// 2. job.ShouldRun? if yes, run it
3939+// 3. otherwise, put it back at then end of the stream
4040+// this means that we'll have to do a lot of json marshalling/unmarshalling though, since we'll have to decode the message to check if we need to run it... is there a better way?
3641func StartScheduler() {
3742 for {
3843 for _, job := range schedules.Items() {