Skip to content

Commit

Permalink
Dev: Don't clear cache if debug > 0 (only dummy cache active)
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed May 23, 2018
1 parent 3d1bb43 commit 34b1e4d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions application/helpers/update/updatedb_helper.php
Expand Up @@ -2248,10 +2248,13 @@ function db_upgrade_all($iOldDBVersion, $bSilent = false)
Survey::model()->refreshMetaData();
Notification::model()->refreshMetaData();

// Try to clear tmp/runtime (database cache files)
// Try to clear tmp/runtime (database cache files).
// Related to problems like https://bugs.limesurvey.org/view.php?id=13699.
Yii::app()->cache->flush();
Yii::app()->cache->gc();
if (!(defined('YII_DEBUG') && YII_DEBUG)) {
Yii::app()->cache->flush();
// NB: CDummyCache does not have a gc method (used if debug > 0).
Yii::app()->cache->gc();
}

// Inform superadmin about update
$superadmins = User::model()->getSuperAdmins();
Expand Down

1 comment on commit 34b1e4d

@Shnoulle
Copy link
Collaborator

@Shnoulle Shnoulle commented on 34b1e4d Jun 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? YII_DEBUG need to be not defined and true ? I think it never happen … ;) sorry parenthesis …

Else : maybe we can test cache directly ? Currently user can force cache in config.php to something other (in general i put -1 to disable file cache if there are multi instance of server with a single DB …)

Please sign in to comment.