- Extract lock checking to internal/lockfile package - Add lock probe in RPC client before connection attempts - Update daemon discovery to use lock probe - Eliminates unnecessary connection attempts when socket missing Closes bd-wgu4 Amp-Thread-ID: https://ampcode.com/threads/T-3b863f21-3af4-49d3-9214-477d904b80fe Co-authored-by: Amp <amp@ampcode.com>
18 lines
359 B
Go
18 lines
359 B
Go
//go:build js && wasm
|
|
|
|
package lockfile
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
var errDaemonLocked = errors.New("daemon lock already held by another process")
|
|
|
|
func flockExclusive(f *os.File) error {
|
|
// WASM doesn't support file locking
|
|
// In a WASM environment, we're typically single-process anyway
|
|
return fmt.Errorf("file locking not supported in WASM")
|
|
}
|