Files
yatm/internal/executor/fileops/operation.go
T
Samuel Cui 4fef653b71 Prepare YATM v1.0.0-alpha.2
Unify file queries and Scan execution, retain indexed Identical results,
improve Job and Preview workflows, and verify release packaging.
2026-10-05 19:08:49 +08:00

25 lines
621 B
Go

package fileops
import (
"context"
"github.com/google/uuid"
"github.com/samuelncui/yatm/internal/executor"
"github.com/samuelncui/yatm/internal/resource"
)
type operation struct {
*resource.TemporaryDB
exe *executor.Executor
}
func newOperation(ctx context.Context, exe *executor.Executor) (*operation, error) {
// The shared resource owns cleanup; the operation keeps its existing temporary namespace.
prefix := ".yatm-fileops-" + uuid.NewString() + "-"
temporary, err := resource.OpenTemporaryDB("", prefix)
if err != nil {
return nil, err
}
return &operation{TemporaryDB: temporary, exe: exe}, nil
}