mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
21 lines
437 B
Go
21 lines
437 B
Go
package ingestion
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
func (i *DefaultIngester) UpdateTaskState(ctx context.Context, state any) error {
|
|
taskState, err := json.Marshal(state)
|
|
if err != nil {
|
|
return fmt.Errorf("error marshaling task state: %w", err)
|
|
}
|
|
|
|
if err = i.store.UpdateTaskState(ctx, i.connectorID, i.descriptor, taskState); err != nil {
|
|
return fmt.Errorf("error updating task state: %w", err)
|
|
}
|
|
|
|
return nil
|
|
}
|