feat: Add reprocess command

This commit is contained in:
2026-06-27 23:30:54 +05:00
parent ae32d9067d
commit 7c469a524b
4 changed files with 85 additions and 12 deletions

View File

@@ -22,6 +22,7 @@ import (
transporthttp "gis/internal/transport/http"
"github.com/go-playground/validator/v10"
"github.com/google/uuid"
"github.com/jackc/pgx/v5/pgxpool"
)
@@ -171,6 +172,12 @@ func (a *App) ExampleConsumer() *rabbitmq.Consumer {
// Publisher returns the RabbitMQ publisher.
func (a *App) Publisher() *rabbitmq.Publisher { return a.publisher }
// ReprocessDataset re-enqueues the processing job for the dataset with the given
// id, restarting its asynchronous pipeline.
func (a *App) ReprocessDataset(ctx context.Context, id uuid.UUID) (domain.Dataset, error) {
return a.datasets.Reprocess(ctx, id)
}
// Close releases all resources in reverse order of acquisition.
func (a *App) Close() {
if a.rabbit != nil {