mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2024-12-25 22:55:55 -05:00
1ce52e334c
Now each syncer has a binary heap of the times it plans to do a flush. When one of those times arrives, it rechecks if there's something to do. Seems more straightforward than rechecking each stream's first uncommitted recording, especially with the logic to retry failed flushes every minute. Also improved the info! log for each flush to see the actual recordings being flushed for better debuggability. No new tests right now. :-( They're tricky to write. One problem is that it's hard to get the timing right: a different flush has to happen after Syncer::save's database operations and before Syncer::run calls SimulatedClocks::recv_timeout with an empty channel[*], advancing the time. I've thought of a few ways of doing this: * adding a new SyncerCommand to run something, but it's messy (have to add it from the mock of one of the actions done by the save), and Box<dyn FnOnce() + 'static> not working (see rust-lang/rust#28796) makes it especially annoying. * replacing SimulatedClocks with something more like MockClocks. Lots of boilerplate. Maybe I need to find a good general-purpose Rust mock library. (mockers sounds good but I want something that works on stable Rust.) * bypassing the Syncer::run loop, instead manually running iterations from the test. Maybe the last way is the best for now. I'm likely to try it soon. [*] actually, it's calling Receiver::recv_timeout directly; Clocks::recv_timeout is dead code now? oops.
70 lines
1.6 KiB
TOML
70 lines
1.6 KiB
TOML
[package]
|
|
name = "moonfire-nvr"
|
|
version = "0.1.0"
|
|
authors = ["Scott Lamb <slamb@slamb.org>"]
|
|
edition = "2018"
|
|
|
|
[features]
|
|
|
|
# The nightly feature is used within moonfire-nvr itself to gate the
|
|
# benchmarks. Also pass it along to crates that can benefit from it.
|
|
nightly = ["db/nightly", "parking_lot/nightly", "smallvec/union"]
|
|
|
|
# The bundled feature includes bundled (aka statically linked) versions of
|
|
# native libraries where possible.
|
|
bundled = ["rusqlite/bundled"]
|
|
|
|
[workspace]
|
|
members = ["base", "db", "ffmpeg"]
|
|
|
|
[dependencies]
|
|
base = { package = "moonfire-base", path = "base" }
|
|
base64 = "0.10.0"
|
|
bytes = "0.4.6"
|
|
byteorder = "1.0"
|
|
db = { package = "moonfire-db", path = "db" }
|
|
docopt = "1.0"
|
|
failure = "0.1.1"
|
|
ffmpeg = { package = "moonfire-ffmpeg", path = "ffmpeg" }
|
|
futures = "0.1"
|
|
futures-cpupool = "0.1"
|
|
fnv = "1.0"
|
|
http = "0.1.5"
|
|
http-serve = "0.1.0"
|
|
hyper = "0.12.9"
|
|
lazy_static = "1.0"
|
|
libc = "0.2"
|
|
log = { version = "0.4", features = ["release_max_level_info"] }
|
|
memchr = "2.0.2"
|
|
memmap = "0.7"
|
|
mylog = { git = "https://github.com/scottlamb/mylog" }
|
|
openssl = "0.10"
|
|
parking_lot = { version = "0.7", features = [] }
|
|
reffers = "0.5.1"
|
|
regex = "1.0"
|
|
ring = "0.12.1"
|
|
rusqlite = "0.16"
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = "1.0"
|
|
smallvec = "0.6"
|
|
time = "0.1"
|
|
tokio = "0.1.8"
|
|
tokio-signal = "0.2"
|
|
url = "1.4"
|
|
uuid = { version = "0.7", features = ["serde", "std", "v4"] }
|
|
|
|
[dev-dependencies]
|
|
reqwest = "0.9.5"
|
|
tempdir = "0.3"
|
|
|
|
[dependencies.cursive]
|
|
version = "0.10"
|
|
#default-features = false
|
|
#features = ["termion-backend"]
|
|
|
|
[profile.release]
|
|
debug = true
|
|
|
|
[profile.bench]
|
|
debug = true
|