File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
collections/implementations Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff 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 ) )
Original file line number Diff line number Diff 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
8888Meteor . startup ( ( ) => {
8989 // Ensure indexes are created on startup:
90- ensureIndexes ( )
90+ createIndexes ( )
9191} )
9292
9393async function cleanupIndexes (
Original file line number Diff line number Diff line change @@ -18,15 +18,19 @@ import { profiler } from '../../api/profiler'
1818import { PromisifyCallbacks } from '@sofie-automation/shared-lib/dist/lib/types'
1919import { AsyncOnlyMongoCollection } from '../collection'
2020
21+ /**
22+ * A stripped down version of Meteor's Mongo.Cursor, with only the async methods
23+ */
2124export 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+ */
2732export 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 >
You can’t perform that action at this time.
0 commit comments