mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(files_sharing): Use session id as part of cache key to avoid concurrency issues
If several people are watching and seeking the same video file we do not want the cache key to be the same or it would flood activity again. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
d9b2178ee1
commit
8b41055297
1 changed files with 3 additions and 3 deletions
|
|
@ -114,12 +114,12 @@ class BeforeNodeReadListener implements IEventListener {
|
|||
}
|
||||
|
||||
/* Avoid publishing several activities for one video playing */
|
||||
$cacheKey = $node->getId() . $node->getPath();
|
||||
if (($this->request->getHeader('range') !== '') && ($this->cache->get($cacheKey) == $this->session->getId())) {
|
||||
$cacheKey = $node->getId() . $node->getPath() . $this->session->getId();
|
||||
if (($this->request->getHeader('range') !== '') && ($this->cache->get($cacheKey) === 'true')) {
|
||||
/* This is a range request and an activity for the same file was published in the same session */
|
||||
return;
|
||||
}
|
||||
$this->cache->set($cacheKey, $this->session->getId(), 3600);
|
||||
$this->cache->set($cacheKey, 'true', 3600);
|
||||
|
||||
$this->singleFileDownloaded($share, $node);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue