|
21 | 21 | * along with this program. If not, see <http://www.gnu.org/licenses/> |
22 | 22 | * |
23 | 23 | */ |
| 24 | + |
24 | 25 | namespace OC\Files\Cache; |
25 | 26 |
|
26 | 27 | use OCP\DB\QueryBuilder\IQueryBuilder; |
27 | 28 | use OCP\Files\Cache\IPropagator; |
| 29 | +use OCP\Files\Storage\IReliableEtagStorage; |
28 | 30 | use OCP\IDBConnection; |
29 | 31 |
|
30 | 32 | /** |
@@ -91,9 +93,11 @@ public function propagateChange($internalPath, $time, $sizeDifference = 0) { |
91 | 93 |
|
92 | 94 | $builder->update('filecache') |
93 | 95 | ->set('mtime', $builder->func()->greatest('mtime', $builder->createNamedParameter((int)$time, IQueryBuilder::PARAM_INT))) |
94 | | - ->set('etag', $builder->createNamedParameter($etag, IQueryBuilder::PARAM_STR)) |
95 | 96 | ->where($builder->expr()->eq('storage', $builder->createNamedParameter($storageId, IQueryBuilder::PARAM_INT))) |
96 | 97 | ->andWhere($builder->expr()->in('path_hash', $hashParams)); |
| 98 | + if (!$this->storage->instanceOfStorage(IReliableEtagStorage::class)) { |
| 99 | + $builder->set('etag', $builder->createNamedParameter($etag, IQueryBuilder::PARAM_STR)); |
| 100 | + } |
97 | 101 |
|
98 | 102 | $builder->execute(); |
99 | 103 |
|
@@ -141,7 +145,7 @@ private function addToBatch($internalPath, $time, $sizeDifference) { |
141 | 145 | $this->batch[$internalPath] = [ |
142 | 146 | 'hash' => md5($internalPath), |
143 | 147 | 'time' => $time, |
144 | | - 'size' => $sizeDifference |
| 148 | + 'size' => $sizeDifference, |
145 | 149 | ]; |
146 | 150 | } else { |
147 | 151 | $this->batch[$internalPath]['size'] += $sizeDifference; |
|
0 commit comments