18 lines
561 B
Go
18 lines
561 B
Go
package app
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"gitea.maximumdirect.net/eric/narratio/internal/artifacts"
|
|
"gitea.maximumdirect.net/eric/narratio/internal/logging"
|
|
)
|
|
|
|
// 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)
|
|
}
|