Skip to content

Commit e72b3fd

Browse files
authored
Merge pull request #5738 from LibreSign/fix/force-cache-update
fix: force cache update
2 parents da11e55 + 0ad469e commit e72b3fd

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lib/Command/Developer/Reset.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use OC\Core\Command\Base;
1212
use OCA\Libresign\AppInfo\Application;
13-
use OCP\DB\QueryBuilder\IQueryBuilder;
13+
use OCP\IAppConfig;
1414
use OCP\IConfig;
1515
use OCP\IDBConnection;
1616
use Psr\Log\LoggerInterface;
@@ -21,6 +21,7 @@
2121
class Reset extends Base {
2222
public function __construct(
2323
private IConfig $config,
24+
private IAppConfig $appConfig,
2425
private IDBConnection $db,
2526
private LoggerInterface $logger,
2627
) {
@@ -224,11 +225,13 @@ private function resetUserElement(): void {
224225

225226
private function resetConfig(): void {
226227
try {
227-
$delete = $this->db->getQueryBuilder();
228-
$delete->delete('appconfig')
229-
->where($delete->expr()->eq('appid', $delete->createNamedParameter(Application::APP_ID)))
230-
->andWhere($delete->expr()->notIn('configkey', $delete->createNamedParameter(['enabled', 'installed_version'], IQueryBuilder::PARAM_STR_ARRAY)))
231-
->executeStatement();
228+
$keys = $this->appConfig->getKeys(Application::APP_ID);
229+
foreach ($keys as $key) {
230+
if ($key === 'enabled' || $key === 'installed_version') {
231+
continue;
232+
}
233+
$this->appConfig->deleteKey(Application::APP_ID, $key);
234+
}
232235
} catch (\Throwable) {
233236
}
234237
}

0 commit comments

Comments
 (0)