reduce panics

This commit is contained in:
faldor20 2024-04-23 14:40:25 +10:00
parent db97e3ed22
commit 712d648cf0
No known key found for this signature in database
GPG key ID: F2216079B890CD57
2 changed files with 19 additions and 8 deletions

View file

@ -74,7 +74,8 @@ impl Registry {
if &document.doc_info.url == updating_url {
//Write the newly analysed document into the oncelock that any request requiring the latest document will be waiting on
if let Some(a) = documents.get_mut(updating_url) {
a.latest_document.set(document.clone()).unwrap()
//We don't care if this fails becasue we expect the document to sometimes alreday be there
a.latest_document.set(document.clone()).unwrap_or(())
}
}