You are here

public function backup_migrate_destination_dropbox::file_cache_clear in Backup and Migrate Dropbox 7.2

Same name and namespace in other branches
  1. 7.3 destinations.dropbox.inc \backup_migrate_destination_dropbox::file_cache_clear()

This destination updates the cache in a smart way. Normally, the list of (remote) files is created and cached in these steps:

  • Create list in list_files() and cache it for 1 day.
  • Clear cache on expiry, save a new backup, remove an existing backup, and refresh (admin/config/system/backup_migrate/backups?refresh=true), but not on settings form submit.

We do this as follows:

  • Create list in list_files() and cache it for 32 days.
  • Clear cache on expiry, change token, change path, and refresh (admin/config/system/backup_migrate/backups?refresh=true).
  • Update cache on save a new backup, and remove an existing backup.

So, refresh should only be necessary when the Dropbox folder gets updated outside Drupal Backup and Migrate.

1 call to backup_migrate_destination_dropbox::file_cache_clear()
backup_migrate_destination_dropbox::edit_form_submit in ./destinations.dropbox.inc
Submit the form for the settings for the files destination.

File

./destinations.dropbox.inc, line 368
destinations.dropbox.inc

Class

backup_migrate_destination_dropbox
A destination for sending database backups to a Dropbox account.

Code

public function file_cache_clear() {

  // Check if we are in a smart caching process and if so, do not clear the
  // cache as we wil be updating it.
  if (!$this->prevent_cache_clear) {
    parent::file_cache_clear();
  }
}