forked from mtusi2026/mtusi2026lab5
19 lines
511 B
Go
19 lines
511 B
Go
package processing
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"path/filepath"
|
|
|
|
"messenger/internal/pipeline"
|
|
"messenger/internal/platform/faultbarrier"
|
|
)
|
|
|
|
// Only the explicit fault experiment enables these one-shot barriers.
|
|
func FileBarrier(dir string) func(context.Context, pipeline.Job, string) error {
|
|
return func(ctx context.Context, j pipeline.Job, phase string) error {
|
|
base := filepath.Join(dir, fmt.Sprintf("%s-v%d-%s", j.AttachmentID, j.PipelineVersion, phase))
|
|
return faultbarrier.Wait(ctx, base, "")
|
|
}
|
|
}
|