(ctx context.Context, db database.Store, templateID uuid.UUID)
| 167 | } |
| 168 | |
| 169 | func (*agplTemplateScheduleStore) Get(ctx context.Context, db database.Store, templateID uuid.UUID) (TemplateScheduleOptions, error) { |
| 170 | ctx, span := tracing.StartSpan(ctx) |
| 171 | defer span.End() |
| 172 | |
| 173 | tpl, err := db.GetTemplateByID(ctx, templateID) |
| 174 | if err != nil { |
| 175 | return TemplateScheduleOptions{}, err |
| 176 | } |
| 177 | |
| 178 | return TemplateScheduleOptions{ |
| 179 | // Disregard the values in the database, since user scheduling is an |
| 180 | // enterprise feature. |
| 181 | UserAutostartEnabled: true, |
| 182 | UserAutostopEnabled: true, |
| 183 | DefaultTTL: time.Duration(tpl.DefaultTTL), |
| 184 | ActivityBump: time.Duration(tpl.ActivityBump), |
| 185 | // Disregard the values in the database, since AutostopRequirement, |
| 186 | // FailureTTL, TimeTilDormant, and TimeTilDormantAutoDelete are enterprise features. |
| 187 | AutostartRequirement: TemplateAutostartRequirement{ |
| 188 | // Default to allowing all days for AGPL |
| 189 | DaysOfWeek: 0b01111111, |
| 190 | }, |
| 191 | AutostopRequirement: TemplateAutostopRequirement{ |
| 192 | // No days means never. The weeks value should always be greater |
| 193 | // than zero though. |
| 194 | DaysOfWeek: 0, |
| 195 | Weeks: 1, |
| 196 | }, |
| 197 | FailureTTL: 0, |
| 198 | TimeTilDormant: 0, |
| 199 | TimeTilDormantAutoDelete: 0, |
| 200 | }, nil |
| 201 | } |
| 202 | |
| 203 | func (*agplTemplateScheduleStore) Set(ctx context.Context, db database.Store, tpl database.Template, opts TemplateScheduleOptions) (database.Template, error) { |
| 204 | ctx, span := tracing.StartSpan(ctx) |
nothing calls this directly
no test coverage detected