mirror of
https://github.com/iv-org/inv_sig_helper.git
synced 2024-11-26 23:50:32 +00:00
Set player_info.last_update when no update was required
This commit is contained in:
parent
cfe85d34bb
commit
e53b6406a0
@ -39,12 +39,13 @@ pub async fn fetch_update(state: Arc<GlobalState>) -> Result<(), FetchUpdateStat
|
|||||||
|
|
||||||
let mut current_player_info = global_state.player_info.lock().await;
|
let mut current_player_info = global_state.player_info.lock().await;
|
||||||
let current_player_id = current_player_info.player_id;
|
let current_player_id = current_player_info.player_id;
|
||||||
// release the mutex for other tasks
|
|
||||||
drop(current_player_info);
|
|
||||||
|
|
||||||
if player_id == current_player_id {
|
if player_id == current_player_id {
|
||||||
|
current_player_info.last_update = SystemTime::now();
|
||||||
return Err(FetchUpdateStatus::PlayerAlreadyUpdated);
|
return Err(FetchUpdateStatus::PlayerAlreadyUpdated);
|
||||||
}
|
}
|
||||||
|
// release the mutex for other tasks
|
||||||
|
drop(current_player_info);
|
||||||
|
|
||||||
// Download the player script
|
// Download the player script
|
||||||
let player_js_url: String = format!(
|
let player_js_url: String = format!(
|
||||||
|
Loading…
Reference in New Issue
Block a user