-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cron.FbStore): store cron jobs as flatbuffers
after reviewing benchmarks, I'm going to remove cbor as a JobStore format. Here's the benchmarks from this commit on my machine: $ go test --bench=. -v --run=XXX -benchmem goos: darwin goarch: amd64 pkg: github.com/qri-io/qri/cron BenchmarkFbJobStore-4 500 2575622 ns/op 655281 B/op 14015 allocs/op BenchmarkFileJobStore-4 10 254254905 ns/op 448635 B/op 10082 allocs/op PASS ok github.com/qri-io/qri/cron 4.308s
- Loading branch information
Showing
14 changed files
with
885 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// IDL file for cron | ||
|
||
namespace cron_fbs; | ||
|
||
table Job { | ||
name:string; | ||
type:string; | ||
lastRun:string; | ||
lastError:string; | ||
periodicity:string; | ||
secrets:[Secret]; | ||
} | ||
|
||
table Secret { | ||
key:string; | ||
val:string; | ||
} | ||
|
||
// flatbuffers don't (currently) support using a vector as a root type | ||
// in an ideal world we'd just `root_type [Job]`, wrapping in this table | ||
// skips the problem and gives us the option to store "store global" state | ||
// issue: https://github.com/google/flatbuffers/issues/4854 | ||
table Jobs { | ||
list:[Job]; | ||
} | ||
|
||
root_type Jobs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.