feat: execute durable client commands through supervisor
This commit is contained in:
@@ -35,15 +35,9 @@ func PersistDispatch(ctx context.Context, store *spool.Store, session Session, d
|
||||
if err != nil {
|
||||
return spool.Acceptance{}, err
|
||||
}
|
||||
acceptance, err := store.AcceptCommand(ctx, spool.Command{IssueUUID: issue, ImmutableSHA256: immutable, Revision: dispatch.GetCommandRevision(), Phase: uint32(rvboxv1.CommandLifecycle_COMMAND_ACCEPTED), ExecutionSpec: spec}, now)
|
||||
if err != nil {
|
||||
return spool.Acceptance{}, err
|
||||
}
|
||||
command := spool.Command{IssueUUID: issue, ImmutableSHA256: immutable, Revision: dispatch.GetCommandRevision(), Phase: uint32(rvboxv1.CommandLifecycle_COMMAND_ACCEPTED), ExecutionSpec: spec}
|
||||
if descriptor := dispatch.GetSpec().GetScript(); descriptor != nil {
|
||||
_, err = store.BeginScript(ctx, issue, spool.ScriptDescriptor{SizeBytes: descriptor.GetSizeBytes(), SHA256: bytesToDigest(descriptor.GetSha256())})
|
||||
if err != nil {
|
||||
return spool.Acceptance{}, err
|
||||
}
|
||||
command.Script = &spool.ScriptDescriptor{SizeBytes: descriptor.GetSizeBytes(), SHA256: bytesToDigest(descriptor.GetSha256())}
|
||||
}
|
||||
return acceptance, nil
|
||||
return store.AcceptCommand(ctx, command, now)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user