@@ -558,6 +558,42 @@ impl GlobalCacheTracker {
558
558
Ok ( rows)
559
559
}
560
560
561
+ // Return all workspace_manifest cache timestamps.
562
+ pub fn workspace_manifest_all ( & self ) -> CargoResult < Vec < ( WorkspaceManifestIndex , Timestamp ) > > {
563
+ let mut stmt = self
564
+ . conn
565
+ . prepare_cached ( "SELECT name, timestamp FROM workspace_manifest_index" ) ?;
566
+ let rows = stmt
567
+ . query_map ( [ ] , |row| {
568
+ let workspace_manifest_path = row. get_unwrap ( 0 ) ;
569
+ let timestamp = row. get_unwrap ( 1 ) ;
570
+ let kind = WorkspaceManifestIndex {
571
+ workspace_manifest_path : workspace_manifest_path,
572
+ } ;
573
+ Ok ( ( kind, timestamp) )
574
+ } ) ?
575
+ . collect :: < Result < Vec < _ > , _ > > ( ) ?;
576
+ Ok ( rows)
577
+ }
578
+
579
+ // Return all target dir cache timestamps.
580
+ pub fn target_dir_all ( & self ) -> CargoResult < Vec < ( TargetDirIndex , Timestamp ) > > {
581
+ let mut stmt = self
582
+ . conn
583
+ . prepare_cached ( "SELECT name, timestamp FROM target_dir_index" ) ?;
584
+ let rows = stmt
585
+ . query_map ( [ ] , |row| {
586
+ let target_dir_path = row. get_unwrap ( 0 ) ;
587
+ let timestamp = row. get_unwrap ( 1 ) ;
588
+ let kind = TargetDirIndex {
589
+ target_dir_path : target_dir_path,
590
+ } ;
591
+ Ok ( ( kind, timestamp) )
592
+ } ) ?
593
+ . collect :: < Result < Vec < _ > , _ > > ( ) ?;
594
+ Ok ( rows)
595
+ }
596
+
561
597
/// Returns whether or not an auto GC should be performed, compared to the
562
598
/// last time it was recorded in the database.
563
599
pub fn should_run_auto_gc ( & mut self , frequency : Duration ) -> CargoResult < bool > {
0 commit comments