File tree 2 files changed +23
-2
lines changed
2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -43,10 +43,11 @@ fn deserialize_path(path: &Path) -> Res {
43
43
}
44
44
45
45
fn main ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
46
- let db = site:: db:: open ( "data" , true ) ;
46
+ let dir = std:: env:: args ( ) . nth ( 1 ) . expect ( "database as first arg" ) ;
47
+ let db = site:: db:: open ( & dir, true ) ;
47
48
let mut index = site:: db:: Index :: load ( & db) ;
48
49
49
- let paths = std:: env:: args ( ) . skip ( 1 ) . collect :: < Vec < _ > > ( ) ;
50
+ let paths = std:: env:: args ( ) . skip ( 2 ) . collect :: < Vec < _ > > ( ) ;
50
51
let paths_count = paths. len ( ) ;
51
52
let mut last = std:: time:: Instant :: now ( ) ;
52
53
for ( idx, path) in paths. into_iter ( ) . enumerate ( ) {
Original file line number Diff line number Diff line change @@ -151,6 +151,26 @@ impl InputData {
151
151
152
152
/// Initialize `InputData from the file system.
153
153
pub fn from_fs ( db : & str ) -> anyhow:: Result < InputData > {
154
+ if std:: path:: Path :: new ( db) . join ( "times" ) . exists ( ) {
155
+ eprintln ! ( "It looks like you're running the site off of the old data format" ) ;
156
+ eprintln ! (
157
+ "Please run the ingestion script pointing at a different directory, like so:"
158
+ ) ;
159
+ eprintln ! (
160
+ " find rustc-timing/times/ -type f | xargs ./target/release/ingest database"
161
+ ) ;
162
+ eprintln ! ( ) ;
163
+ eprintln ! ( "And optionally follow up by shrinking the database:" ) ;
164
+ eprintln ! ( " ./target/release/compact database" ) ;
165
+ eprintln ! ( "" ) ;
166
+ eprintln ! ( "You can run the ingestion script repeatedly over all the files," ) ;
167
+ eprintln ! ( "or you can run it on just some newly collected data." ) ;
168
+ eprintln ! (
169
+ "The ingestion script must not be run in parallel with the site (it should error)."
170
+ ) ;
171
+ std:: process:: exit ( 1 ) ;
172
+ }
173
+
154
174
let config = if let Ok ( s) = fs:: read_to_string ( "site-config.toml" ) {
155
175
toml:: from_str ( & s) ?
156
176
} else {
You can’t perform that action at this time.
0 commit comments