MCPcopy Index your code
hub / github.com/endbasic/endbasic / cleanup

Method cleanup

client/src/cloud.rs:488–528  ·  view source on GitHub ↗
(service: &mut AutoDeletingService<S>)

Source from the content-addressed store, hash-verified

486 #[tokio::main]
487 #[allow(clippy::single_match)]
488 async fn cleanup<S: Service>(service: &mut AutoDeletingService<S>) {
489 if let Some((username, _password)) = service.current_user.as_ref() {
490 service
491 .service
492 .logout()
493 .await
494 .map_err(|e| {
495 format!("Failed to log out for {} during cleanup: {}", username, e)
496 })
497 .unwrap();
498 }
499
500 for (filename, (username, password)) in service.files_to_delete.iter() {
501 service
502 .service
503 .login(username, password)
504 .await
505 .map_err(|e| {
506 format!("Failed to log in for {} during cleanup: {}", username, e)
507 })
508 .unwrap();
509
510 service
511 .service
512 .delete_file(username, filename)
513 .await
514 .map_err(|e| {
515 format!("Failed to delete file {} during cleanup: {}", filename, e)
516 })
517 .unwrap();
518
519 service
520 .service
521 .logout()
522 .await
523 .map_err(|e| {
524 format!("Failed to log out for {} during cleanup: {}", username, e)
525 })
526 .unwrap();
527 }
528 }
529 cleanup(self);
530 }
531 }

Callers

nothing calls this directly

Calls 4

iterMethod · 0.80
logoutMethod · 0.45
loginMethod · 0.45
delete_fileMethod · 0.45

Tested by

no test coverage detected