NewPatchingHandler creates a new patching handler.
( patchRuns *store.PatchRunsStore, patchPolicies *store.PatchPoliciesStore, assignments *store.PatchPolicyAssignmentsStore, exclusions *store.PatchPolicyExclusionsStore, hosts *store.HostsStore, settings *store.SettingsStore, cfg *config.Config, queueClient *asynq.Client, queueInspector *asynq.Inspector, notify *notifications.Emitter, log *slog.Logger, )
| 64 | |
| 65 | // NewPatchingHandler creates a new patching handler. |
| 66 | func NewPatchingHandler( |
| 67 | patchRuns *store.PatchRunsStore, |
| 68 | patchPolicies *store.PatchPoliciesStore, |
| 69 | assignments *store.PatchPolicyAssignmentsStore, |
| 70 | exclusions *store.PatchPolicyExclusionsStore, |
| 71 | hosts *store.HostsStore, |
| 72 | settings *store.SettingsStore, |
| 73 | cfg *config.Config, |
| 74 | queueClient *asynq.Client, |
| 75 | queueInspector *asynq.Inspector, |
| 76 | notify *notifications.Emitter, |
| 77 | log *slog.Logger, |
| 78 | ) *PatchingHandler { |
| 79 | if log == nil { |
| 80 | log = slog.Default() |
| 81 | } |
| 82 | return &PatchingHandler{ |
| 83 | patchRuns: patchRuns, |
| 84 | patchPolicies: patchPolicies, |
| 85 | assignments: assignments, |
| 86 | exclusions: exclusions, |
| 87 | hosts: hosts, |
| 88 | settings: settings, |
| 89 | cfg: cfg, |
| 90 | queueClient: queueClient, |
| 91 | queueInspector: queueInspector, |
| 92 | notify: notify, |
| 93 | log: log, |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | // resolveOrgTimezone returns the IANA timezone name resolved for the current |
| 98 | // request context. It prefers TZ / TIMEZONE env vars, then the org-wide |