Commit 9d3355fe authored by Matthias Neugebauer's avatar Matthias Neugebauer
Browse files

Fix missed updated from other Opencast instances

parent 4d1f1c0d
......@@ -107,12 +107,18 @@ public class PrivacyPolicyServiceImpl implements PrivacyPolicyService, ManagedSe
return true;
try {
Tuple<String, String> key = tuple(securityService.getOrganization().getId(), username);
return cache.get(tuple(securityService.getOrganization().getId(), username)) == hit;
if (cache.get(key) == hit)
return true;
// Invalidate misses as the DB could be updated from another Opencast instance.
cache.invalidate(key);
} catch (ExecutionException e) {
logger.error("Could not determine if consent given; assuming not: {}", ExceptionUtils.getStackTrace(e));
return false;
}
return false;
}
@Override
......@@ -186,7 +192,7 @@ public class PrivacyPolicyServiceImpl implements PrivacyPolicyService, ManagedSe
em.remove(consentDto);
// Update cache
cache.put(tuple(orgId, username), miss);
cache.invalidate(tuple(orgId, username));
}
private void addConsent(EntityManager em, String orgId, String username) {
......
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