forked from daytonaio/daytona
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add project status check when opening (daytonaio#822)
Signed-off-by: titanventura <[email protected]> Signed-off-by: johnwick <[email protected]>
- Loading branch information
1 parent
b0637b8
commit 182a9b2
Showing
3 changed files
with
45 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright 2024 Daytona Platforms Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package util | ||
|
||
import "github.com/daytonaio/daytona/pkg/apiclient" | ||
|
||
func IsProjectRunning(workspace *apiclient.WorkspaceDTO, projectName string) bool { | ||
for _, project := range workspace.GetProjects() { | ||
if project.GetName() == projectName { | ||
uptime := project.GetState().Uptime | ||
return uptime != nil && *uptime != 0 | ||
} | ||
} | ||
return false | ||
} |