-
Notifications
You must be signed in to change notification settings - Fork 848
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
Signed-off-by: titanventura <[email protected]>
- Loading branch information
1 parent
c6e3e86
commit 6eb9ddb
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 | ||
} |