Skip to content

Commit 33f53cb

Browse files
committed
chore: minor fixes after code review
1 parent c593560 commit 33f53cb

File tree

6 files changed

+18
-19
lines changed

6 files changed

+18
-19
lines changed

meteor/server/Connections.ts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { deferAsync, getCurrentTime } from './lib/lib'
1+
import { deferAsync, getCurrentTime, MeteorStartupAsync } from './lib/lib'
22
import { Meteor } from 'meteor/meteor'
33
import { logger } from './logging'
44
import { sendTrace } from './api/integration/influx'
@@ -83,20 +83,19 @@ function traceConnections() {
8383
}, 1000)
8484
}
8585

86-
Meteor.startup(() => {
86+
MeteorStartupAsync(async () => {
8787
// Reset the connection status of the devices
88-
deferAsync(async () => {
89-
await PeripheralDevices.updateAsync(
90-
{
91-
connected: true,
92-
lastSeen: { $lt: getCurrentTime() - 60 * 1000 },
93-
},
94-
{
95-
$set: {
96-
connected: false,
97-
},
88+
89+
await PeripheralDevices.updateAsync(
90+
{
91+
connected: true,
92+
lastSeen: { $lt: getCurrentTime() - 60 * 1000 },
93+
},
94+
{
95+
$set: {
96+
connected: false,
9897
},
99-
{ multi: true }
100-
)
101-
})
98+
},
99+
{ multi: true }
100+
)
102101
})

meteor/server/api/deviceTriggers/RundownsObserver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Rundowns } from '../../collections'
44
import { literal } from '@sofie-automation/corelib/dist/lib'
55
import { MongoFieldSpecifierOnesStrict } from '@sofie-automation/corelib/dist/mongo'
66
import { DBRundown } from '@sofie-automation/corelib/dist/dataModel/Rundown'
7-
import { PromiseDebounce } from '../../publications/lib/debounce'
7+
import { PromiseDebounce } from '../../publications/lib/PromiseDebounce'
88

99
const REACTIVITY_DEBOUNCE = 20
1010

meteor/server/api/deviceTriggers/StudioObserver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { ContentCache } from './reactiveContentCache'
2020
import { RundownContentObserver } from './RundownContentObserver'
2121
import { RundownsObserver } from './RundownsObserver'
2222
import { RundownPlaylists, Rundowns, ShowStyleBases } from '../../collections'
23-
import { PromiseDebounce } from '../../publications/lib/debounce'
23+
import { PromiseDebounce } from '../../publications/lib/PromiseDebounce'
2424

2525
type ChangedHandler = (showStyleBaseId: ShowStyleBaseId, cache: ContentCache) => () => void
2626

File renamed without changes.

meteor/server/publications/lib/__tests__/debounce.test.ts renamed to meteor/server/publications/lib/__tests__/PromiseDebounce.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { sleep } from '@sofie-automation/shared-lib/dist/lib/lib'
2-
import { PromiseDebounce } from '../debounce'
2+
import { PromiseDebounce } from '../PromiseDebounce'
33

44
describe('PromiseDebounce', () => {
55
beforeEach(() => {

meteor/server/publications/lib/rundownsObserver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Meteor } from 'meteor/meteor'
22
import { RundownId, RundownPlaylistId, StudioId } from '@sofie-automation/corelib/dist/dataModel/Ids'
33
import { Rundowns } from '../../collections'
4-
import { PromiseDebounce } from './debounce'
4+
import { PromiseDebounce } from './PromiseDebounce'
55

66
const REACTIVITY_DEBOUNCE = 20
77

0 commit comments

Comments
 (0)