In order to mitigate against the brute force attacks against Gitlab accounts, we are moving to all edu-ID Logins. We would like to remind you to link your account with your edu-id. Login will be possible only by edu-ID after November 30, 2021. Here you can find the instructions for linking your account.

If you don't have a SWITCH edu-ID, you can create one with this guide here

kind regards

This Server has been upgraded to GitLab release 14.2.6

Unverified Commit 43a27f47 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

don't return error when directory does not exist

parent 82ee16c5
......@@ -141,6 +141,10 @@ impl Collection {
/// Updates the media index for a certain directory
pub fn update_media_index(&mut self, dir: &Path) -> Result<()> {
if !dir.exists() {
debug!("{} does not exist therefore skipping indexing of it", dir.to_str().unwrap_or(""));
return Ok(())
}
if dir.ends_with("media") {
self.dissemination_copies =
Collection::scan_media_folder(dir).context("Couldn't scan folder media")?;
......
......@@ -60,7 +60,7 @@ impl Svc {
fn refresh_partial_cache_if_outdated(&mut self, collection_id: &str) -> Result<()> {
if let Ok(mut x) = self.media_cache.lock() {
if x.collection_is_outdated(collection_id, &self.partial_cache_timeout) {
info!("Partial media cache is outdated! Regenerating");
info!("Partial media cache for {} is outdated! Regenerating", collection_id);
x.refresh_collection(collection_id)
} else {
Ok(())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment