Skip to content

Commit

Permalink
Merge pull request #34 from alcounit/develop
Browse files Browse the repository at this point in the history
Fix issue #33
  • Loading branch information
alcounit authored Apr 13, 2021
2 parents 2aac7a8 + b19725b commit a283926
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,17 @@ func (app *App) HandleStatus(w http.ResponseWriter, r *http.Request) {
}

func parseImage(image string) (container string) {
pref, err := regexp.Compile("[^a-zA-Z0-9]+")
if err != nil {
return "selenoid-browser"
browser := "browser"
if len(image) > 0 {
pref, err := regexp.Compile("[^a-zA-Z0-9]+")
if err != nil {
return browser
}
fragments := strings.Split(image, "/")
image = fragments[len(fragments)-1]
return pref.ReplaceAllString(image, "-")
}
return pref.ReplaceAllString(image, "-")
return browser
}

func getSessionStats(sessions []platform.Service) (active []platform.Service, pending []platform.Service) {
Expand Down
2 changes: 1 addition & 1 deletion selenosis.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func New(logger *log.Logger, client platform.Platform, browsers *config.Browsers
if quota, err = client.Quota().Get(); err != nil {
quota, err = client.Quota().Create(currentTotal())
if err != nil {
logger.Errorf("failed to create quota resource: %v", err)
logger.Fatalf("failed to create quota resource: %v", err)
}
}

Expand Down

0 comments on commit a283926

Please sign in to comment.