fix compilation error in benchmark

This needs a separate run of "cargo +nightly bench --features=nightly", so I
missed it in a couple previous commits. I probably should set up travis-ci...
This commit is contained in:
Scott Lamb 2018-02-22 21:57:43 -08:00
parent bf45ae6011
commit d9841fd634
1 changed files with 5 additions and 6 deletions

View File

@ -165,7 +165,6 @@ pub fn add_dummy_recordings_to_db(db: &db::Database, num: usize) {
const START_TIME: recording::Time = recording::Time(1430006400i64 * TIME_UNITS_PER_SEC); const START_TIME: recording::Time = recording::Time(1430006400i64 * TIME_UNITS_PER_SEC);
const DURATION: recording::Duration = recording::Duration(5399985); const DURATION: recording::Duration = recording::Duration(5399985);
let mut recording = db::RecordingToInsert { let mut recording = db::RecordingToInsert {
id: db::CompositeId::new(TEST_STREAM_ID, 1),
sample_file_bytes: 30104460, sample_file_bytes: 30104460,
flags: 0, flags: 0,
time: START_TIME .. (START_TIME + DURATION), time: START_TIME .. (START_TIME + DURATION),
@ -177,13 +176,13 @@ pub fn add_dummy_recordings_to_db(db: &db::Database, num: usize) {
sample_file_sha1: [0; 20], sample_file_sha1: [0; 20],
run_offset: 0, run_offset: 0,
}; };
let mut tx = db.tx().unwrap(); for _ in 0..num {
for i in 0..num { let (_, u) = db.add_recording(TEST_STREAM_ID).unwrap();
tx.insert_recording(&recording).unwrap(); u.lock().recording = Some(recording.clone());
recording.id = db::CompositeId::new(TEST_STREAM_ID, 2 + i as i32); u.lock().synced = true;
recording.time.start += DURATION; recording.time.start += DURATION;
recording.time.end += DURATION; recording.time.end += DURATION;
recording.run_offset += 1; recording.run_offset += 1;
} }
tx.commit().unwrap(); db.flush("add_dummy_recordings_to_db").unwrap();
} }