func (repo *RepositoryConfig) PurgeAt(hour int, min int, retention string, kind MediaKind) {
	dur, err := time.ParseDuration(retention) // e.g. "14d", "24h"
	if err != nil {
		panic(err)
	}

	// a tiny function to encapsulate what we need to do when we reach our start time
	job := func() {
		defer func() {
			if r := recover(); r != nil {
				log.Error("RepositoryConfig.Purge.job", "panic in purge job function", r)
			}
		}()

		when := time.Now().Add(-dur)
		repo.PurgeBefore(kind, when)
	}

	go scheduler("purger", hour, min, job)
}
// PurgeAt configures a job to purge the indicated kind of image according to
// the indicated retention period to run each day at the indicated time.
PurgeAt configures a job to purge the indicated kind of image according to
the indicated retention period to run each day at the indicated time.
// PurgeAt configures a job to purge the indicated kind of image according to // the indicated retention period to run each day at the indicated time .
func (repo *RepositoryConfig) PurgeAt(hour int, min int, retention string, kind MediaKind) {
	dur, err := time.ParseDuration(retention) 
	if err != nil {
		panic(err)
	}
	job := func() {
		defer func() {
			if r := recover(); r != nil {
				log.Error("RepositoryConfig.Purge.job", "panic in purge job function", r)
			}
		}()
		when := time.Now().Add(-dur)
		repo.PurgeBefore(kind, when)
	}
	go scheduler("purger", hour, min, job)
}
func ( repo * RepositoryConfig ) PurgeAt ( hour int , min int , retention string , kind MediaKind ) { dur , err := time . ParseDuration ( retention ) if err != nil { panic ( err ) } job := func ( ) { defer func ( ) { if r := recover ( ) ; r != nil { log . Error ( " " , " " , r ) } } ( ) when := time . Now ( ) . Add ( - dur ) repo . PurgeBefore ( kind , when ) } go scheduler ( " " , hour , min , job ) }
PurgeAt configures a job to purge the indicated kind of image according to
the indicated retention period to run each day at the indicated time.
PurgeAt configures a job to purge the indicated kind of image according to the indicated retention period to run each day at the indicated time .
// e.g. "14d", "24h" // a tiny function to encapsulate what we need to do when we reach our start time