generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # backend/controller/console/console.go # backend/controller/controller.go # backend/controller/timeline/events_async.go # backend/controller/timeline/events_call.go # backend/controller/timeline/events_cron.go # backend/controller/timeline/events_ingress.go # backend/controller/timeline/events_log.go # backend/controller/timeline/events_pubsub_consume.go # backend/controller/timeline/events_pubsub_publish.go # backend/controller/timeline/timeline.go # Conflicts: # backend/controller/controller.go # backend/controller/timeline/timeline.go # Conflicts: # backend/controller/console/console.go
- Loading branch information
Showing
3 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package timeline | ||
|
||
// TODO: cron service needs to call this | ||
// type CronScheduled struct { | ||
// DeploymentKey model.DeploymentKey | ||
// Verb schema.Ref | ||
|
||
// Time time.Time | ||
// ScheduledAt time.Time | ||
// Schedule string | ||
// Error optional.Option[string] | ||
// } | ||
|
||
// func (e *CronScheduled) toEvent() (Event, error) { //nolint:unparam | ||
// return &CronScheduledEvent{ | ||
// CronScheduled: *e, | ||
// Duration: time.Since(e.Time), | ||
// }, nil | ||
// } | ||
|
||
// type eventCronScheduledJSON struct { | ||
// DurationMS int64 `json:"duration_ms"` | ||
// ScheduledAt time.Time `json:"scheduled_at"` | ||
// Schedule string `json:"schedule"` | ||
// Error optional.Option[string] `json:"error,omitempty"` | ||
// } | ||
|
||
// func (s *Service) insertCronScheduledEvent(ctx context.Context, querier sql.Querier, event *CronScheduledEvent) error { | ||
// cronJSON := eventCronScheduledJSON{ | ||
// DurationMS: event.Duration.Milliseconds(), | ||
// ScheduledAt: event.ScheduledAt, | ||
// Schedule: event.Schedule, | ||
// Error: event.Error, | ||
// } | ||
|
||
// data, err := json.Marshal(cronJSON) | ||
// if err != nil { | ||
// return fmt.Errorf("failed to marshal cron JSON: %w", err) | ||
// } | ||
|
||
// var payload ftlencryption.EncryptedTimelineColumn | ||
// err = s.encryption.EncryptJSON(json.RawMessage(data), &payload) | ||
// if err != nil { | ||
// return fmt.Errorf("failed to encrypt cron JSON: %w", err) | ||
// } | ||
|
||
// err = libdal.TranslatePGError(querier.InsertTimelineCronScheduledEvent(ctx, sql.InsertTimelineCronScheduledEventParams{ | ||
// DeploymentKey: event.DeploymentKey, | ||
// TimeStamp: event.Time, | ||
// Module: event.Verb.Module, | ||
// Verb: event.Verb.Name, | ||
// Payload: payload, | ||
// })) | ||
// if err != nil { | ||
// return fmt.Errorf("failed to insert cron event: %w", err) | ||
// } | ||
// return err | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters