2026-12-02 00:38:15 +00:00
|
|
|
package app
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"fmt"
|
|
|
|
|
|
2026-12-03 02:01:48 +00:00
|
|
|
"gitea.maximumdirect.net/eric/narratio/v4/internal/artifacts"
|
|
|
|
|
"gitea.maximumdirect.net/eric/narratio/v4/internal/logging"
|
2026-12-02 00:38:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// acquireWorkspaceLock identifies acquisition before a potentially blocking wait.
|
|
|
|
|
func acquireWorkspaceLock(ctx context.Context, store artifacts.Store, root string, reporter logging.Reporter) (*artifacts.LockHandle, error) {
|
|
|
|
|
if reporter != nil {
|
|
|
|
|
reporter.Progress(fmt.Sprintf("acquiring workspace lock %q", artifacts.WorkspaceLockPath(root)))
|
|
|
|
|
}
|
|
|
|
|
return store.AcquireWorkspaceLockContext(ctx)
|
|
|
|
|
}
|