do frontend (preact)
This commit is contained in:
@@ -131,6 +131,7 @@ pub async fn websocket(
|
||||
ws.on_upgrade(async move |mut socket| {
|
||||
let mut subscription = state.leaderboard.subscribe();
|
||||
|
||||
// let mut first = true;
|
||||
loop {
|
||||
let payload = {
|
||||
let LeaderboardWatchedInfo {
|
||||
@@ -138,6 +139,13 @@ pub async fn websocket(
|
||||
ref message,
|
||||
} = *subscription.borrow_and_update();
|
||||
|
||||
// for testing the error message:
|
||||
// if first {
|
||||
// first = false;
|
||||
// format!("{}\tok\t{data}", expiry.to_rfc3339())
|
||||
// } else {
|
||||
// format!("{}\terr\terrormessage", expiry.to_rfc3339())
|
||||
// }
|
||||
match message {
|
||||
Ok(data) => format!("{}\tok\t{data}", expiry.to_rfc3339()),
|
||||
Err(err) => format!("{}\terr\t{err}", expiry.to_rfc3339()),
|
||||
|
||||
Reference in New Issue
Block a user