Reset last sync timestamp for given scope, this forces synced to sync
 all the records on the next sync. Useful for cases when you add
 a new column to be synced and you use updated since strategy for faster
 synchronization.
176946
def reset_synced(scope: scope_from_relation)
      options = {
        scope:                 scope,
        strategy:              synced_strategy,
        only_updated:          synced_only_updated,
        initial_sync_since:    synced_initial_sync_since,
        timestamp_strategy:    synced_timestamp_strategy,
        synced_endpoint:       synced_endpoint
      }
      Synced::Synchronizer.new(self, options).reset_synced
    end
1309558
def _add_updated_at_column(self, values):
        
        if not self._model.uses_timestamps():
            return values

        column = self._model.get_updated_at_column()

        if "updated_at" not in values:
            values.update({column: self._model.fresh_timestamp_string()})

        return values
831567
@Override
    public void changed(@NonNull DatabaseChange change) {
        synchronized (lock) {
            if (willUpdate) {
                return; // Already a pending update scheduled
            }

            if (!observing) { return; }

            // Schedule an update, respecting the updateInterval:
            long updateDelay = lastUpdatedAt + DEFAULT_LIVE_QUERY_UPDATE_INTERVAL - System.currentTimeMillis();
            updateDelay = Math.max(0, Math.min(DEFAULT_LIVE_QUERY_UPDATE_INTERVAL, updateDelay));
            update(updateDelay);
        }
    }
445290
def with_timestamps(self, created_at=None, updated_at=None):
        
        if not created_at:
            created_at = self.created_at()

        if not updated_at:
            updated_at = self.updated_at()

        return self.with_pivot(created_at, updated_at)
303788
def last_updated(self):
        '''
        
        '''
        derived_path = self.context.request.url
        timestamp_key = self.timestamp_key_for(derived_path)

        if self.exists(self.timestamp_key_for, derived_path):
            return self.storage.get(timestamp_key)

        return None
704649
def update(self, value, timestamp=None):
        

        if timestamp is None:
            timestamp = self.current_time_in_fractional_seconds()
        self.rescale_if_needed()
        priority = self.weight(timestamp - self.start_time) / random.random()
        self.values[priority] = value
        if len(self.values) > self.size:
            self.values.remove_min()
1190965
def synchronize_clock(self, offset):
        

        self.time_offset = offset - self.uptime
        self.is_utc = True

        if self.has_rtc:
            self.stored_offset = self.time_offset
511173
@Override
	public void update() {
		synchronized (this) {
			long currentTime = System.currentTimeMillis();
			if (currentTime - lastUpdateTime > updateInterval) {
				lastUpdateTime = currentTime;
				fetchMetrics();
			}
		}
	}
376868
def method_missing(method_sym, *arguments, &block)
      # Only refresh data if its more than 0.25 seconds old
      et = @last_read_timestamp.nil? ? 0 : (Time.now - @last_read_timestamp)
      @logger.debug "Elapsed time since last read #{et}"
      if et > 250
        @logger.info "More than 250 milliseconds have passed since last read. Triggering refresh."
        read()
      end

      if @values.include? method_sym
        @values[method_sym]
      else
        @logger.debug "method_missing failed to find #{method_sym} in the Meter.values cache"
        super
      end
    end
533562
public void setLastUpdatedTimes(java.util.Collection<DateTimeRange> lastUpdatedTimes) {
        if (lastUpdatedTimes == null) {
            this.lastUpdatedTimes = null;
            return;
        }

        this.lastUpdatedTimes = new java.util.ArrayList<DateTimeRange>(lastUpdatedTimes);
    }
1027352
protected function updateTimestamps()
    {
        $time = $this->freshTimestamp();

        if (! is_null(static::UPDATED_AT) && ! $this->hasChanged(static::UPDATED_AT)) {
            $this->setUpdatedAt($time);
        }

        if (! $this->exists && ! is_null(static::CREATED_AT) &&
            ! $this->hasChanged(static::CREATED_AT)) {
            $this->setCreatedAt($time);
        }
    }
507372
def was_modified_since_last_sync(self):
        
        info = self.get_sync_info()
        if not info:
            return None
        if self.size != info["s"]:
            return True
        if self.mtime > info["m"]:
            return True
        return False
396024
function() {
    var self = this
    self._shouldSyncFromOpts = true
    self.on('update', function() {
      if (self._shouldSyncFromOpts) self.trigger('sync')
      self._shouldSyncFromOpts = true
    })
  }
381999
function updateQueryForNextPage(pulledRecords) {
        return Platform.async(function(callback) {
            callback();
        })().then(function() {

            if (!pulledRecords) {
                throw new Error('Something is wrong. pulledRecords cannot be null at this point');
            }

            var lastRecord = pulledRecords[ pulledRecords.length - 1];

            if (!lastRecord) {
                throw new Error('Something is wrong. Possibly invalid response from the server. lastRecord cannot be null!');
            }

            var lastRecordTime = lastRecord[tableConstants.sysProps.updatedAtColumnName];

            if (!_.isDate(lastRecordTime)) {
                throw new Error('Property ' + tableConstants.sysProps.updatedAtColumnName + ' of the last record should be a valid date');
            }

            if (lastRecordTime.getTime() === lastKnownUpdatedAt.getTime()) {
                pagePullQuery.skip(pagePullQuery.getComponents().skip + pulledRecords.length);
            } else {
                buildQueryFromLastKnownUpdateAt(lastRecordTime);
            }
        });
    }
75853
public void syncRecordToBase(Record recBase, Record recAlt, boolean syncSelection)
    {
        if ((recAlt != null) && (recBase != null))
        {
            recBase.moveFields(recAlt, null, true, DBConstants.READ_MOVE, false, false, true, syncSelection);
            recBase.setEditMode(recAlt.getEditMode());
        }
        if ((recBase.getEditMode() == DBConstants.EDIT_CURRENT) || (recBase.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
            recBase.handleValidRecord(); // Do listeners, Display Fields
        else if (recBase.getEditMode() == DBConstants.EDIT_ADD)
            recBase.handleNewRecord(); // Do listeners, Display Fields
        //?recBase.setKeyArea(recAlt.getDefaultOrder());
    }
12562
def set_updated(self):
        
        # get latest output
        output = []
        for method in self.methods.values():
            data = method["last_output"]
            if isinstance(data, list):
                if self.testing and data:
                    data[0]["cached_until"] = method.get("cached_until")
                output.extend(data)
            else:
                # if the output is not 'valid' then don't add it.
                if data.get("full_text") or "separator" in data:
                    if self.testing:
                        data["cached_until"] = method.get("cached_until")
                    output.append(data)
        # if changed store and force display update.
        if output != self.last_output:
            # has the modules output become urgent?
            # we only care the update that this happens
            # not any after then.
            urgent = True in [x.get("urgent") for x in output]
            if urgent != self.urgent:
                self.urgent = urgent
            else:
                urgent = False
            self.last_output = output
            self._py3_wrapper.notify_update(self.module_full_name, urgent)
271796
private void updateCurrentChunk(boolean lastChunk) throws IOException {
    // Early return for the most common case.
    if (mCurrentChunk != null && mCurrentChunk.writableBytes() > 0 && !lastChunk) {
      return;
    }

    if (mCurrentChunk == null) {
      if (!lastChunk) {
        mCurrentChunk = allocateBuffer();
      }
      return;
    }

    if (mCurrentChunk.writableBytes() == 0 || lastChunk) {
      try {
        if (mCurrentChunk.readableBytes() > 0) {
          for (DataWriter dataWriter : mDataWriters) {
            mCurrentChunk.retain();
            dataWriter.writeChunk(mCurrentChunk.duplicate());
          }
        } else {
          Preconditions.checkState(lastChunk);
        }
      } finally {
        // If the packet has bytes to read, we increment its refcount explicitly for every packet
        // writer. So we need to release here. If the packet has no bytes to read, then it has
        // to be the last packet. It needs to be released as well.
        mCurrentChunk.release();
        mCurrentChunk = null;
      }
    }
    if (!lastChunk) {
      mCurrentChunk = allocateBuffer();
    }
  }