Commit

Packages: name the download counter's key

syntaqxcommitted Parentef25f19Browse files
1 file+3−10/1 viewed
+3−1
6767 /// where it is counted too): written at most every few seconds, so a
6868 /// busy image costs one write, not one a pull. What an isolate holds
6969 /// when it goes away is lost: the count is approximate.
70− static DOWNLOADS: RefCell<(HashMap<(String, Option<String>), u64>, u64)> = RefCell::new((HashMap::new(), 0));
70+ static DOWNLOADS: RefCell<(HashMap<DownloadKey, u64>, u64)> = RefCell::new((HashMap::new(), 0));
7171 }
7272 const DOWNLOADS_FLUSH_MS: u64 = 10_000;
73+/// A package's id, and a version's when the download counts for it too.
74+type DownloadKey = (String, Option<String>);
7375
7476 thread_local! {
7577 /// What billing allows each workspace, as asked last, and when.