Skip to content

[usage] Filter out not started workspace instances #12696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 6, 2022

Conversation

easyCZ
Copy link
Member

@easyCZ easyCZ commented Sep 6, 2022

Description

Related Issue(s)

Fixes #

How to test

Release Notes

NONE

Documentation

Werft options:

  • /werft with-preview

@easyCZ easyCZ requested a review from a team September 6, 2022 13:44
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Sep 6, 2022
@roboquat roboquat added the size/S label Sep 6, 2022
@@ -224,10 +223,8 @@ type WorkspaceInstanceForUsage struct {
Type WorkspaceType `gorm:"column:workspaceType;type:char;size:16;default:regular;" json:"workspaceType"`
UsageAttributionID AttributionID `gorm:"column:usageAttributionId;type:varchar;size:60;" json:"usageAttributionId"`

CreationTime VarcharTime `gorm:"column:creationTime;type:varchar;size:255;" json:"creationTime"`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removes these fields as they are just confusing. They did not get removed originally when we switched to stoppingTime

@@ -134,6 +134,7 @@ func ListWorkspaceInstancesInRange(ctx context.Context, conn *gorm.DB, from, to
Where(
conn.Where("wsi.stoppingTime >= ?", TimeToISO8601(from)).Or("wsi.stoppingTime = ?", ""),
).
Where("wsi.startedTime != ?", "").
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thansk @easyCZ ! 🚀

@@ -134,6 +134,7 @@ func ListWorkspaceInstancesInRange(ctx context.Context, conn *gorm.DB, from, to
Where(
conn.Where("wsi.stoppingTime >= ?", TimeToISO8601(from)).Or("wsi.stoppingTime = ?", ""),
).
Where("wsi.startedTime != ?", "").
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where we filter out any without a started time

@easyCZ easyCZ force-pushed the mp/usage-filter-out-not-started branch from 4b7c7b9 to b0ff117 Compare September 6, 2022 13:52
@roboquat roboquat merged commit eb9b579 into main Sep 6, 2022
@roboquat roboquat deleted the mp/usage-filter-out-not-started branch September 6, 2022 14:00
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/S team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants