mirror of
https://github.com/emo2007/block-accounting.git
synced 2025-01-18 15:36:27 +00:00
dispatching init
This commit is contained in:
parent
c0d7b0bfe1
commit
7797f8a364
@ -3,6 +3,7 @@ package workers
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
|
||||||
"github.com/emochka2007/block-accounting/internal/infrastructure/queue"
|
"github.com/emochka2007/block-accounting/internal/infrastructure/queue"
|
||||||
@ -71,9 +72,33 @@ func (w *Worker) handleJobs(ch <-chan amqp.Delivery) {
|
|||||||
// TODO check job.IdempotentKey for duplicate
|
// TODO check job.IdempotentKey for duplicate
|
||||||
|
|
||||||
// TODO dispatch job
|
// TODO dispatch job
|
||||||
|
switch job.Payload.(type) {
|
||||||
|
case *queue.JobDeployMultisig:
|
||||||
|
jdm, ok := job.Payload.(*queue.JobDeployMultisig)
|
||||||
|
if !ok {
|
||||||
|
w.log.Error(
|
||||||
|
"error invalid job type",
|
||||||
|
slog.String("job_id", job.ID),
|
||||||
|
slog.String("job_key", job.IdempotencyKey),
|
||||||
|
)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := w.handleDeployMultisig(job.Context, jdm); err != nil {
|
||||||
|
w.log.Error(
|
||||||
|
"error handle deploy multisig job",
|
||||||
|
slog.String("job_id", job.ID),
|
||||||
|
slog.String("job_key", job.IdempotencyKey),
|
||||||
|
logger.Err(err),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *Worker) handleDeployMultisig(
|
func (w *Worker) handleDeployMultisig(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
)
|
dm *queue.JobDeployMultisig,
|
||||||
|
) error {
|
||||||
|
return fmt.Errorf("error unimplemented")
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user