Skip to content

Commit e1c079e

Browse files
committed
Show last sync times
1 parent a68f1f5 commit e1c079e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/packages/storage.gleam

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,8 @@ pub fn year_internet_points(
643643

644644
pub type InternetPoints {
645645
InternetPoints(
646+
last_partial_sync: Timestamp,
647+
last_full_sync: Timestamp,
646648
total_downloads: Int,
647649
package_counts: List(#(String, Int)),
648650
release_counts: List(#(String, Int)),
@@ -717,7 +719,12 @@ pub fn internet_points(database: Database) -> Result(InternetPoints, Error) {
717719
}),
718720
)
719721

722+
use last_partial_sync <- result.try(get_hex_sync_time(database, PartialSync))
723+
use last_full_sync <- result.try(get_hex_sync_time(database, FullSync))
724+
720725
Ok(InternetPoints(
726+
last_full_sync:,
727+
last_partial_sync:,
721728
total_downloads: acc.total_downloads,
722729
package_counts: acc.package_counts
723730
|> dict.to_list

src/packages/web/page.gleam

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ pub fn year_internet_points(
5959

6060
pub fn internet_points(stats: storage.InternetPoints) -> String {
6161
html.div([], [
62+
html.h2([], [html.text("Last partial sync")]),
63+
html.text(format_date(stats.last_partial_sync)),
64+
html.h2([], [html.text("Last full sync")]),
65+
html.text(format_date(stats.last_full_sync)),
6266
html.h2([], [html.text("Total downloads")]),
6367
html.text(pretty_int(stats.total_downloads)),
6468
html.h2([], [html.text("Packages total downloads")]),

0 commit comments

Comments
 (0)