Skip to content

Commit 2095210

Browse files
committed
chore: minor docs after code review
1 parent 5a58f71 commit 2095210

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

meteor/server/api/rest/koa.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,14 @@ Meteor.startup(() => {
4646
)
4747

4848
// Expose the API at the url
49-
WebApp.rawConnectHandlers.use((req, res) => {
49+
WebApp.rawHandlers.use((req, res) => {
5050
const transaction = profiler.startTransaction(`${req.method}:${req.url}`, 'http.incoming')
5151
if (transaction) {
5252
transaction.setLabel('url', `${req.url}`)
5353
transaction.setLabel('method', `${req.method}`)
5454

5555
res.on('finish', () => {
56+
// When the end of the request is sent to the client, submit the apm transaction
5657
let route = req.originalUrl
5758
if (req.originalUrl && req.url && req.originalUrl.endsWith(req.url.slice(1)) && req.url.length > 1) {
5859
route = req.originalUrl.slice(0, -1 * (req.url.length - 1))

meteor/server/api/system.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ async function setupIndexes(removeOldIndexes = false): Promise<Array<IndexSpecif
7373
)
7474
return removeIndexes
7575
}
76-
function ensureIndexes(): void {
76+
function createIndexes(): void {
7777
const indexes = getTargetRegisteredIndexes()
7878
if (!Meteor.isServer) throw new Meteor.Error(500, `setupIndexes() can only be run server-side`)
7979

@@ -87,7 +87,7 @@ function ensureIndexes(): void {
8787

8888
Meteor.startup(() => {
8989
// Ensure indexes are created on startup:
90-
ensureIndexes()
90+
createIndexes()
9191
})
9292

9393
async function cleanupIndexes(

meteor/server/collections/implementations/asyncCollection.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,19 @@ import { profiler } from '../../api/profiler'
1818
import { PromisifyCallbacks } from '@sofie-automation/shared-lib/dist/lib/types'
1919
import { AsyncOnlyMongoCollection } from '../collection'
2020

21+
/**
22+
* A stripped down version of Meteor's Mongo.Cursor, with only the async methods
23+
*/
2124
export type MinimalMongoCursor<T extends { _id: ProtectedString<any> }> = Pick<
2225
MongoCursor<T>,
2326
'fetchAsync' | 'observeChangesAsync' | 'observeAsync' | 'countAsync'
2427
// | 'forEach' | 'map' |
2528
>
26-
29+
/**
30+
* A stripped down version of Meteor's Mongo.Collection, with only the async methods
31+
*/
2732
export type MinimalMeteorMongoCollection<T extends { _id: ProtectedString<any> }> = Pick<
2833
Mongo.Collection<T>,
29-
// | 'find'
3034
'insertAsync' | 'removeAsync' | 'updateAsync' | 'upsertAsync' | 'rawCollection' | 'rawDatabase' | 'createIndex'
3135
> & {
3236
find: (...args: Parameters<Mongo.Collection<T>['find']>) => MinimalMongoCursor<T>

0 commit comments

Comments
 (0)