diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-09-30 16:12:16 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-09-30 16:12:16 +0200 |
commit | 91d12a2f3d860c25ae8daa0cfd838fd6deba5dec (patch) | |
tree | 7f56836fd5dfb60c37727f4d50bfc8afa4f7bd5f /lib/filecache.php | |
parent | 113c339c41663c692eae809ada23c4057f9e3ff0 (diff) | |
download | nextcloud-server-91d12a2f3d860c25ae8daa0cfd838fd6deba5dec.tar.gz nextcloud-server-91d12a2f3d860c25ae8daa0cfd838fd6deba5dec.zip |
update the filecache by setting mtimes to 0 when the mount configuration has changed instead of clearing the cache
Diffstat (limited to 'lib/filecache.php')
-rw-r--r-- | lib/filecache.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/filecache.php b/lib/filecache.php index 07099bcccd5..305ba035fb5 100644 --- a/lib/filecache.php +++ b/lib/filecache.php @@ -488,6 +488,20 @@ class OC_FileCache{ $query->execute(); } } + + /** + * trigger an update for the cache by setting the mtimes to 0 + * @param string $user (optional) + */ + public static function triggerUpdate($user=''){ + if($user) { + $query=OC_DB::prepare('UPDATE `*PREFIX*fscache` SET `mtime`=0 WHERE `user`=? AND `mimetype`="httpd/unix-directory"'); + $query->execute(array($user)); + }else{ + $query=OC_DB::prepare('UPDATE `*PREFIX*fscache` SET `mtime`=0 AND `mimetype`="httpd/unix-directory"'); + $query->execute(); + } + } } //watch for changes and try to keep the cache up to date |