MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / updateHookStatus

Method updateHookStatus

internal/hooks/client.go:213–232  ·  view source on GitHub ↗
(ctx context.Context, hook *Hook, success bool)

Source from the content-addressed store, hash-verified

211}
212
213func (m *redisHookManager) updateHookStatus(ctx context.Context, hook *Hook, success bool) error {
214 hook.LastRun = time.Now()
215 hook.LastSuccess = success
216
217 logrus.WithFields(logrus.Fields{
218 "hook_id": hook.ID,
219 "hook_name": hook.Name,
220 "hook_type": hook.Type,
221 "success": success,
222 "last_run": hook.LastRun,
223 }).Info("Updated hook execution status")
224
225 data, err := json.Marshal(hook)
226 if err != nil {
227 return fmt.Errorf("failed to marshal hook: %w", err)
228 }
229
230 key := fmt.Sprintf("%s:%s", hookKeyPrefix, hook.ID)
231 return m.client.Set(ctx, key, data, 0).Err()
232}

Callers 1

executeHookMethod · 0.95

Calls 2

SetMethod · 0.65
InfoMethod · 0.45

Tested by

no test coverage detected