mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-28 12:36:30 +00:00
Expose a multi process mutex lock file config
This commit is contained in:
parent
8246fc6723
commit
c865e83143
4 changed files with 16 additions and 11 deletions
2
configs/config.yaml
vendored
2
configs/config.yaml
vendored
|
|
@ -114,6 +114,8 @@ emulator:
|
|||
repo:
|
||||
# enable auto-download for the list of cores (list->lib)
|
||||
sync: true
|
||||
# external cross-process mutex lock
|
||||
extLock: "{user}/.cr/cloud-game.lock"
|
||||
main:
|
||||
type: buildbot
|
||||
url: https://buildbot.libretro.com/nightly
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ type LibretroConfig struct {
|
|||
}
|
||||
Repo struct {
|
||||
Sync bool
|
||||
ExtLock string
|
||||
Main LibretroRepoConfig
|
||||
Secondary LibretroRepoConfig
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,17 +61,16 @@ func (c *Config) ParseFlags() {
|
|||
|
||||
// expandSpecialTags replaces all the special tags in the config.
|
||||
func (c *Config) expandSpecialTags() {
|
||||
// home dir
|
||||
dir := c.Emulator.Storage
|
||||
if dir != "" {
|
||||
tag := "{user}"
|
||||
if strings.Contains(dir, tag) {
|
||||
userHomeDir, err := environment.GetUserHome()
|
||||
if err != nil {
|
||||
log.Fatalln("couldn't read user home directory", err)
|
||||
}
|
||||
c.Emulator.Storage = strings.Replace(dir, tag, userHomeDir, -1)
|
||||
tag := "{user}"
|
||||
for _, dir := range []*string{&c.Emulator.Storage, &c.Emulator.Libretro.Cores.Repo.ExtLock} {
|
||||
if *dir == "" || !strings.Contains(*dir, tag) {
|
||||
continue
|
||||
}
|
||||
userHomeDir, err := environment.GetUserHome()
|
||||
if err != nil {
|
||||
log.Fatalln("couldn't read user home directory", err)
|
||||
}
|
||||
*dir = strings.Replace(*dir, tag, userHomeDir, -1)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,10 @@ type Manager struct {
|
|||
func NewRemoteHttpManager(conf emulator.LibretroConfig) Manager {
|
||||
repoConf := conf.Cores.Repo.Main
|
||||
// used for synchronization of multiple process
|
||||
fileLock := os.TempDir() + string(os.PathSeparator) + "cloud_game.lock"
|
||||
fileLock := conf.Cores.Repo.ExtLock
|
||||
if fileLock == "" {
|
||||
fileLock = os.TempDir() + string(os.PathSeparator) + "cloud_game.lock"
|
||||
}
|
||||
|
||||
arch, err := core.GetCoreExt()
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue