8000 chore: remove notifications experiment by dannykopping · Pull Request #14869 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

chore: remove notifications experiment #14869

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 8 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Ensuring done channel cannot be closed twice
Signed-off-by: Danny Kopping <danny@coder.com>
  • Loading branch information
dannykopping committed Oct 1, 2024
commit 0aa6d7becd3bccedef2d4e9074e59c4c2db7a34d
9 changes: 6 additions & 3 deletions coderd/notifications/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type Manager struct {

runOnce sync.Once
stopOnce sync.Once
doneOnce sync.Once
stop chan any
done chan any

Expand Down Expand Up @@ -153,9 +154,9 @@ func (m *Manager) Run(ctx context.Context) {
// events, creating a notifier, and publishing bulk dispatch result updates to the store.
func (m *Manager) loop(ctx context.Context) error {
defer func() {
if m.notifier != nil {
m.doneOnce.Do(func() {
close(m.done)
}
})
m.log.Info(context.Background(), "notification manager stopped")
}()

Expand Down Expand Up @@ -366,7 +367,9 @@ func (m *Manager) Stop(ctx context.Context) error {
// If the notifier hasn't been started, we don't need to wait for anything.
// This is only really during testing when we want to enqueue messages only but not deliver them.
if m.notifier == nil {
close(m.done)
m.doneOnce.Do(func() {
close(m.done)
})
} else {
m.notifier.stop()
}
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/DeploySettingsPage/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import NotificationsIcon from "@mui/icons-material/NotificationsNoneOutlined";
import Globe from "@mui/icons-material/PublicOutlined";
import ApprovalIcon from "@mui/icons-material/VerifiedUserOutlined";
import VpnKeyOutlined from "@mui/icons-material/VpnKeyOutlined";
import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge";
import { GitIcon } from "components/Icons/GitIcon";
import {
Sidebar as BaseSidebar,
SidebarNavItem,
} from "components/Sidebar/Sidebar";
import { useDashboard } from "modules/dashboard/useDashboard";
import type { FC } from "react";
import { FeatureStageBadge } from "components/FeatureStageBadge/FeatureStageBadge";

export const Sidebar: FC = () => {
const { experiments } = useDashboard();
Expand Down
Loading
0