You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let stored_missing = self.load_missing().unwrap();
267
+
268
+
// if stored_missing contains all potential missing, and to_upload.txt isn't empty, we can fail fast rather than checking each image again
269
+
if missing.iter().all(|v| stored_missing.contains(v)){
270
+
let to_upload = self.load_to_upload().unwrap();
271
+
if !to_upload.is_empty(){
272
+
eprintln!("{} images need to be uploaded to s3 ({} missing), run ./imageflow_core/tests/visuals/upload.sh and delete to_upload.txt", to_upload.len(), missing.len());
273
+
returnfalse;// We're in a "missing" state, we can just stop now.
274
+
}
275
+
}
276
+
277
+
self.record_missing(&missing);
278
+
279
+
let probably_missing = missing.iter().map(|v| v.clone()).collect::<Vec<String>>();
let index = missing.iter().position(|v| v == &name).unwrap();
304
+
uploaded.push(name);
305
+
missing.remove(index);
306
+
self.save_uploaded(&uploaded).unwrap();
307
+
self.record_missing(&missing);
308
+
}
309
+
}
310
+
if !missing.is_empty(){
311
+
eprintln!("See {} for list of images missing from s3",self.missing_index.display());
312
+
}
313
+
314
+
if !nowhere.is_empty(){
315
+
eprintln!("\x1b[31m!!!! {} images are missing both locally and on s3!\x1b[0m", nowhere.len());
316
+
eprintln!("\x1b[31mSee {} for list of actively needed images that are missing both locally and on s3!\x1b[0m",self.missing_everywhere_index.display());
317
+
for name in&nowhere {
318
+
println!("Missing from S3 and locally: {} from s3 {}", name,self.image_url(&name));
319
+
}
320
+
}
321
+
if !to_upload.is_empty(){
322
+
323
+
// yellow text
324
+
eprintln!("\x1b[33mSee {} for list of images that are present locally but missing from s3\x1b[0m",self.missing_everywhere_index.display());
325
+
for name in&to_upload {
326
+
println!("Missing from S3 but present locally: {} from s3 {}", name,self.image_url(&name));
327
+
}
328
+
self.record_to_upload(&to_upload);
329
+
330
+
}
331
+
if missing.is_empty() && nowhere.is_empty() && to_upload.is_empty(){
332
+
println!("All actively used images are uploaded!");
333
+
returntrue;
334
+
}else{
335
+
// red text
336
+
eprintln!("\x1b[31mUploads not complete. Run ./imageflow_core/tests/visuals/upload.sh to upload missing images\x1b[0m");
0 commit comments