// PurgeTimestamps implements TimestampPurger.
765382
func (ad *Attempt_Data) PurgeTimestamps() {
	if ad == nil {
		return
	}
	ad.Created = nil
	ad.Modified = nil
	if p, _ := ad.AttemptType.(TimestampPurger); p != nil {
		p.PurgeTimestamps()
	}
}
1003766
func (s *FaceDetection) SetTimestamp(v int64) *FaceDetection {
	s.Timestamp = &v
	return s
}
530707
func (s *logger) SetTimestampFlags(flags int) {
	s.flags = flags
	s.l.SetFlags(flags)
}
1212291
func (st *State) ControllerTimestamp() (*time.Time, error) {
	now := st.clock().Now()
	return &now, nil
}
881811
func WriteTimestamps(bkt *bolt.Bucket, created, updated time.Time) error {
	createdAt, err := created.MarshalBinary()
	if err != nil {
		return err
	}
	updatedAt, err := updated.MarshalBinary()
	if err != nil {
		return err
	}
	for _, v := range [][2][]byte{
		{bucketKeyCreatedAt, createdAt},
		{bucketKeyUpdatedAt, updatedAt},
	} {
		if err := bkt.Put(v[0], v[1]); err != nil {
			return err
		}
	}

	return nil
}
1048582
func (a *DispatchMouseEventArgs) SetTimestamp(timestamp TimeSinceEpoch) *DispatchMouseEventArgs {
	a.Timestamp = timestamp
	return a
}
1358799
func (cfs *cacheFSObjects) purgeTrash() {
	ticker := time.NewTicker(time.Minute * cacheCleanupInterval)
	defer ticker.Stop()

	for {
		select {
		case <-GlobalServiceDoneCh:
			return
		case <-ticker.C:
			trashPath := path.Join(cfs.fsPath, minioMetaBucket, cacheTrashDir)
			entries, err := readDir(trashPath)
			if err != nil {
				return
			}
			for _, entry := range entries {
				ctx := logger.SetReqInfo(context.Background(), &logger.ReqInfo{})
				fi, err := fsStatVolume(ctx, pathJoin(trashPath, entry))
				if err != nil {
					continue
				}
				dir := path.Join(trashPath, fi.Name())

				// Delete all expired cache content.
				fsRemoveAll(ctx, dir)
			}
		}
	}
}
193006
func (s *UsageRecord) SetTimestamp(v time.Time) *UsageRecord {
	s.Timestamp = &v
	return s
}
444378
func purge(tsv TabletService, name string, purgeAfter, purgeInterval time.Duration) {
	ctx, cancel := context.WithTimeout(tabletenv.LocalContext(), purgeInterval)
	defer func() {
		tabletenv.LogError()
		cancel()
	}()
	for {
		count, err := tsv.PurgeMessages(ctx, nil, name, time.Now().Add(-purgeAfter).UnixNano())
		if err != nil {
			MessageStats.Add([]string{name, "PurgeFailed"}, 1)
			log.Errorf("Unable to delete messages: %v", err)
		} else {
			MessageStats.Add([]string{name, "Purged"}, count)
		}
		// If deleted 500 or more, we should continue.
		if count < 500 {
			return
		}
	}
}
663508
func ClockTimestamp(db XODB) (time.Time, error) {
	var err error

	// sql query
	const sqlstr = `SELECT pg_catalog.clock_timestamp()`

	// run query
	var ret time.Time
	XOLog(sqlstr)
	err = db.QueryRow(sqlstr).Scan(&ret)
	if err != nil {
		return time.Time{}, err
	}

	return ret, nil
}
783779
func (s *ThingConnectivity) SetTimestamp(v int64) *ThingConnectivity {
	s.Timestamp = &v
	return s
}
228603
func (s *SampledHTTPRequest) SetTimestamp(v time.Time) *SampledHTTPRequest {
	s.Timestamp = &v
	return s
}
284031
func (s *Datapoint) SetTimestamp(v time.Time) *Datapoint {
	s.Timestamp = &v
	return s
}
816370
func updateAllocTimestamps(allocations []*structs.Allocation, timestamp int64) {
	for _, alloc := range allocations {
		if alloc.CreateTime == 0 {
			alloc.CreateTime = timestamp
		}
		alloc.ModifyTime = timestamp
	}
}
1350434
func (s *TrustedAdvisorCheckSummary) SetTimestamp(v string) *TrustedAdvisorCheckSummary {
	s.Timestamp = &v
	return s
}
645192
func (ttl *SnapshotTTL) Purge(age time.Duration) (time.Duration, error) {
	ctx := datastore.Get()
	defer ctx.Metrics().Stop(ctx.Metrics().Start("SnapshotTTL.Purge"))

	logger := plog.WithField("age", int(age.Minutes()))

	expire := time.Now().Add(-age)
	var tenantIDs []string
	var unused struct{}
	if err := ttl.client.GetTenantIDs(unused, &tenantIDs); err != nil {
		logger.WithError(err).Error("Could not look up tenantIDs")
		return 0, err
	}

	for _, tenantID := range tenantIDs {
		var snapshots []dao.SnapshotInfo
		if err := ttl.client.ListSnapshots(tenantID, &snapshots); err != nil {
			logger.WithField("tenantid", tenantID).
				WithError(err).Error("Could not look up snapshots for tenant service")
			return 0, err
		}
		for _, s := range snapshots {
			//ignore snapshots that have any tag
			if len(s.Tags) == 0 {
				// check the age of the snapshot
				if timeToLive := s.Created.Sub(expire); timeToLive <= 0 {
					snapshotLogger := logger.WithFields(log.Fields{
						"tenantid": tenantID,
						"snapshotid": s.SnapshotID,
					})
					if err := ttl.client.DeleteSnapshot(s.SnapshotID, nil); err != nil {
						snapshotLogger.WithError(err).Error("Could not delete snapshot")
						return 0, err
					}
					snapshotLogger.Debug("Deleted snapshot")
				} else if timeToLive < age {
					// set the new time to live based on the age of the
					// oldest non-expired snapshot.
					age = timeToLive
				}
			}
		}
	}
	logger.WithField("age", int(age.Minutes())).Debug("Finished Purge")

	return age, nil
}
1299691
func (s *MetricDatum) SetTimestamp(v time.Time) *MetricDatum {
	s.Timestamp = &v
	return s
}