Skip to content

Commit

Permalink
set default timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
jsawo committed May 18, 2023
1 parent 21dbdaf commit 070796c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ func Load() {
}

AppConfig = GetFreshConfig()

if AppConfig.TinkerTimeout == 0 {
AppConfig.TinkerTimeout = defaultTinkerTimeout
}
}

func GetCurrentProject() ProjectConfig {
Expand Down
3 changes: 2 additions & 1 deletion config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import (
)

const DefaultCommand = "php artisan tinker"
const defaultTinkerTimeout = 4

func setDefaults() {
defaultProjectId := project.GetNewId()
projectDef := "projects." + defaultProjectId

viper.Set("currentproject", defaultProjectId)
viper.Set("tinkerTimeout", 2)
viper.Set("tinkerTimeout", defaultTinkerTimeout)
viper.Set(projectDef+".id", defaultProjectId)
viper.Set(projectDef+".command", DefaultCommand)
viper.Set(projectDef+".name", "Unnamed")
Expand Down

0 comments on commit 070796c

Please sign in to comment.