Set the new cache refresh interval
976954
def refresh_interval(self, refresh_interval):
        
        if isinstance(refresh_interval, int) and refresh_interval > 0:
            self._refresh_interval = refresh_interval
        else:
            self._refresh_interval = None
1358900
public void refreshItems(List<CacheItem> itemsToRefresh, Cache cache) {
        for (CacheItem item : itemsToRefresh) {
            try {
                refreshItem(item, cache);
            } catch (Exception ex) {
                logger.error("Refresh for " + getScopeAndKeyString(item) + " failed", ex);
            }
        }
    }
913881
def _cache_is_expired():
        """"""
        now = timezone.now()
        timediff = TransCache.SINGLETON_CREATION_DATETIME - now
        return (timediff.total_seconds() > TransCache.SINGLETON_EXPIRATION_MAX_SECONDS)
1035857
def refresh(self, new_path=None, force_current=False):
        """"""
        if new_path is None:
            new_path = getcwd_or_home()
        if force_current:
            index = self.set_current_folder(new_path)
            self.expand(index)
            self.setCurrentIndex(index)
        self.set_previous_enabled.emit(
                             self.histindex is not None and self.histindex > 0)
        self.set_next_enabled.emit(self.histindex is not None and \
                                   self.histindex < len(self.history)-1)
        # Disable the view of .spyproject. 
        self.filter_directories()
942084
@SuppressWarnings("FutureReturnValueIgnored")
  void refreshIfNeeded(Node<K, V> node, long now) {
    if (!refreshAfterWrite()) {
      return;
    }
    K key;
    V oldValue;
    long oldWriteTime = node.getWriteTime();
    long refreshWriteTime = (now + ASYNC_EXPIRY);
    if (((now - oldWriteTime) > refreshAfterWriteNanos())
        && ((key = node.getKey()) != null) && ((oldValue = node.getValue()) != null)
        && node.casWriteTime(oldWriteTime, refreshWriteTime)) {
      try {
        CompletableFuture<V> refreshFuture;
        long startTime = statsTicker().read();
        if (isAsync) {
          @SuppressWarnings("unchecked")
          CompletableFuture<V> future = (CompletableFuture<V>) oldValue;
          if (Async.isReady(future)) {
            @SuppressWarnings("NullAway")
            CompletableFuture<V> refresh = future.thenCompose(value ->
              cacheLoader.asyncReload(key, value, executor));
            refreshFuture = refresh;
          } else {
            // no-op if load is pending
            node.casWriteTime(refreshWriteTime, oldWriteTime);
            return;
          }
        } else {
          @SuppressWarnings("NullAway")
          CompletableFuture<V> refresh = cacheLoader.asyncReload(key, oldValue, executor);
          refreshFuture = refresh;
        }
        refreshFuture.whenComplete((newValue, error) -> {
          long loadTime = statsTicker().read() - startTime;
          if (error != null) {
            logger.log(Level.WARNING, "Exception thrown during refresh", error);
            node.casWriteTime(refreshWriteTime, oldWriteTime);
            statsCounter().recordLoadFailure(loadTime);
            return;
          }

          @SuppressWarnings("unchecked")
          V value = (isAsync && (newValue != null)) ? (V) refreshFuture : newValue;

          boolean[] discard = new boolean[1];
          compute(key, (k, currentValue) -> {
            if (currentValue == null) {
              return value;
            } else if ((currentValue == oldValue) && (node.getWriteTime() == refreshWriteTime)) {
              return value;
            }
            discard[0] = true;
            return currentValue;
          }, /* recordMiss */ false, /* recordLoad */ false, /* recordLoadFailure */ true);

          if (discard[0] && hasRemovalListener()) {
            notifyRemoval(key, value, RemovalCause.REPLACED);
          }
          if (newValue == null) {
            statsCounter().recordLoadFailure(loadTime);
          } else {
            statsCounter().recordLoadSuccess(loadTime);
          }
        });
      } catch (Throwable t) {
        node.casWriteTime(refreshWriteTime, oldWriteTime);
        logger.log(Level.SEVERE, "Exception thrown when submitting refresh task", t);
      }
    }
  }
1289083
def _Start_refresh_timer(self):
		
		if self._refreshPeriod > 60:
			interval = self._refreshPeriod - 60
		else:
			interval = 60
		self._refreshTimer = Timer(self._refreshPeriod, self.Refresh)
		# TODO:handle exit and logout active connections. revert from daemon then
		self._refreshTimer.setDaemon(True)
		self._refreshTimer.start()
429816
def init_requests_cache(refresh_cache=False):
    
    # Cache data from external sources; used in some checks
    dirs = AppDirs("stix2-validator", "OASIS")
    # Create cache dir if doesn't exist
    try:
        os.makedirs(dirs.user_cache_dir)
    except OSError as e:
        if e.errno != errno.EEXIST:
            raise
    requests_cache.install_cache(
        cache_name=os.path.join(dirs.user_cache_dir, 'py{}cache'.format(
            sys.version_info[0])),
        expire_after=datetime.timedelta(weeks=1))

    if refresh_cache:
        clear_requests_cache()
1270720
def update_cache(self, data=None):
        
        if data:
            self.cache_data = data
        self.cache_updated = timezone.now()
        self.save()
1352690
public function refresh() {
    $response = $this->client->get($this->path());
    $this->setData($response->json());
  }
687007
def FlushCache(self):
    """"""
    self._cache = b''
    self._cache_start_offset = None
    self._cache_end_offset = None
    self._ResetDecompressorState()
1363189
function setCache($cache,$expire=3600)
	{
		$this->cache = $cache;
		$this->if_cache = true;
		$this->expire = $expire;
	}
25409
def updateCache(self, service, url, new_data, new_data_dt):
        
        key = self._get_key(service, url)

        # clear existing data
        try:
            value = self.client.get(key)
            if value:
                data = pickle.loads(value, encoding="utf8")
                if "time_stamp" in data:
                    cached_data_dt = parse(data["time_stamp"])
                    if new_data_dt > cached_data_dt:
                        self.client.delete(key)
                        # may raise MemcachedException
                        logger.info(
                            "IN cache (key: {}), older DELETE".format(key))
                    else:
                        logger.info(
                            "IN cache (key: {}), newer KEEP".format(key))
                        return
            else:
                logger.info("NOT IN cache (key: {})".format(key))

        except MemcachedException as ex:
            logger.error(
                "Clear existing data (key: {}) ==> {}".format(key, str(ex)))
            return

        # store new value in cache
        cdata, time_to_store = self._make_cache_data(
            service, url, new_data, {}, 200, new_data_dt)

        self.client.set(key, cdata, time=time_to_store)
        # may raise MemcachedException
        logger.info(
            "MemCached SET (key {}) for {:d} seconds".format(
                key, time_to_store))
1360012
def refresh_from_server(self):
        """"""
        group = self.manager.get(id=self.id)
        self.__init__(self.manager, **group.data)
1257245
private void enableRefresh() {
        this.refreshButton.setEnabled(true);
        this.autoRefreshLabel.setEnabled(true);
        this.autoRefreshComboBox.setEnabled(true);
        updateAutoRefreshTimer();
    }
223084
def _refresh_show(self, dt):
        
        d = self.declaration
        if dt <= 0:
            #: Done, hide
            d.show = False
        elif d.show:
            #: If user didn't cancel it, keep it alive
            self.toast.show()

            t = min(1000, dt)
            app = self.get_context()
            app.timed_call(t, self._refresh_show, dt-t)
344971
def refresh_until_present(timeout = 30)
      message = "waiting for #{@selector.inspect} to become present"
      Watir::WaitWithRefresh.refresh_until(browser, timeout, message) { present? }
    end
226812
protected void increaseRefreshInterval() {
		refreshInterval = Math.min(REFRESH_INTERVALS.size() - 1, refreshInterval + 1);

		// reset view
		resetAllParts();

		synchronized (refreshThread) {
			refreshThread.notify();
		}
	}