Skip to content

Commit 7f73d90

Browse files
committed
Fix lint
1 parent 281b545 commit 7f73d90

File tree

6 files changed

+17
-7
lines changed

6 files changed

+17
-7
lines changed

coderd/autobuild/lifecycle_executor.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import (
1919
"github.com/coder/coder/v2/coderd/database/dbtime"
2020
"github.com/coder/coder/v2/coderd/database/provisionerjobs"
2121
"github.com/coder/coder/v2/coderd/database/pubsub"
22+
"github.com/coder/coder/v2/coderd/dormancy"
2223
"github.com/coder/coder/v2/coderd/notifications"
2324
"github.com/coder/coder/v2/coderd/schedule"
2425
"github.com/coder/coder/v2/coderd/wsbuilder"
25-
"github.com/coder/coder/v2/enterprise/coderd/dormancy"
2626
)
2727

2828
// Executor automatically starts or stops workspaces.
@@ -326,11 +326,14 @@ func (e *Executor) runOnce(t time.Time) Stats {
326326
}
327327
}
328328
if dormantNotification != nil {
329-
dormancy.NotifyWorkspaceDormant(
329+
_, err = dormancy.NotifyWorkspaceDormant(
330330
e.ctx,
331331
e.notificationsEnqueuer,
332332
*dormantNotification,
333333
)
334+
if err != nil {
335+
e.log.Warn(e.ctx, "failed to notify of workspace "+dormantNotification.Workspace.Name+" marked as dormant", slog.Error(err))
336+
}
334337
}
335338
return nil
336339
}()

enterprise/coderd/dormancy/notifications.go renamed to coderd/dormancy/notifications.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// This package is located outside of the enterprise package to ensure
2+
// accessibility in the putWorkspaceDormant function. This design choice allows
3+
// workspaces to be taken out of dormancy even if the license has expired,
4+
// ensuring critical functionality remains available without an active
5+
// enterprise license.
16
package dormancy
27

38
import (

coderd/workspaces.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/coder/coder/v2/coderd/database/dbauthz"
2424
"github.com/coder/coder/v2/coderd/database/dbtime"
2525
"github.com/coder/coder/v2/coderd/database/provisionerjobs"
26+
"github.com/coder/coder/v2/coderd/dormancy"
2627
"github.com/coder/coder/v2/coderd/httpapi"
2728
"github.com/coder/coder/v2/coderd/httpmw"
2829
"github.com/coder/coder/v2/coderd/rbac"
@@ -34,7 +35,6 @@ import (
3435
"github.com/coder/coder/v2/coderd/wsbuilder"
3536
"github.com/coder/coder/v2/codersdk"
3637
"github.com/coder/coder/v2/codersdk/agentsdk"
37-
"github.com/coder/coder/v2/enterprise/coderd/dormancy"
3838
)
3939

4040
var (

enterprise/coderd/schedule/template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ import (
1616
"github.com/coder/coder/v2/coderd/database"
1717
"github.com/coder/coder/v2/coderd/database/dbauthz"
1818
"github.com/coder/coder/v2/coderd/database/dbtime"
19+
"github.com/coder/coder/v2/coderd/dormancy"
1920
"github.com/coder/coder/v2/coderd/notifications"
2021
agpl "github.com/coder/coder/v2/coderd/schedule"
2122
"github.com/coder/coder/v2/coderd/tracing"
2223
"github.com/coder/coder/v2/codersdk"
23-
"github.com/coder/coder/v2/enterprise/coderd/dormancy"
2424
)
2525

2626
// EnterpriseTemplateScheduleStore provides an agpl.TemplateScheduleStore that

enterprise/coderd/templates_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ import (
77
"testing"
88
"time"
99

10-
"cdr.dev/slog"
11-
"cdr.dev/slog/sloggers/slogtest"
1210
"github.com/google/uuid"
1311
"github.com/stretchr/testify/assert"
1412
"github.com/stretchr/testify/require"
1513

14+
"cdr.dev/slog"
15+
"cdr.dev/slog/sloggers/slogtest"
16+
1617
"github.com/coder/coder/v2/coderd/audit"
1718
"github.com/coder/coder/v2/coderd/coderdtest"
1819
"github.com/coder/coder/v2/coderd/database"

enterprise/coderd/workspaces_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import (
77
"testing"
88
"time"
99

10-
"cdr.dev/slog"
1110
"github.com/stretchr/testify/require"
1211

12+
"cdr.dev/slog"
13+
1314
"cdr.dev/slog/sloggers/slogtest"
1415

1516
"github.com/coder/coder/v2/coderd/audit"

0 commit comments

Comments
 (0)