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(() => {
46
46
)
47
47
48
48
// Expose the API at the url
49
- WebApp . rawConnectHandlers . use ( ( req , res ) => {
49
+ WebApp . rawHandlers . use ( ( req , res ) => {
50
50
const transaction = profiler . startTransaction ( `${ req . method } :${ req . url } ` , 'http.incoming' )
51
51
if ( transaction ) {
52
52
transaction . setLabel ( 'url' , `${ req . url } ` )
53
53
transaction . setLabel ( 'method' , `${ req . method } ` )
54
54
55
55
res . on ( 'finish' , ( ) => {
56
+ // When the end of the request is sent to the client, submit the apm transaction
56
57
let route = req . originalUrl
57
58
if ( req . originalUrl && req . url && req . originalUrl . endsWith ( req . url . slice ( 1 ) ) && req . url . length > 1 ) {
58
59
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
73
73
)
74
74
return removeIndexes
75
75
}
76
- function ensureIndexes ( ) : void {
76
+ function createIndexes ( ) : void {
77
77
const indexes = getTargetRegisteredIndexes ( )
78
78
if ( ! Meteor . isServer ) throw new Meteor . Error ( 500 , `setupIndexes() can only be run server-side` )
79
79
@@ -87,7 +87,7 @@ function ensureIndexes(): void {
87
87
88
88
Meteor . startup ( ( ) => {
89
89
// Ensure indexes are created on startup:
90
- ensureIndexes ( )
90
+ createIndexes ( )
91
91
} )
92
92
93
93
async function cleanupIndexes (
Original file line number Diff line number Diff line change @@ -18,15 +18,19 @@ import { profiler } from '../../api/profiler'
18
18
import { PromisifyCallbacks } from '@sofie-automation/shared-lib/dist/lib/types'
19
19
import { AsyncOnlyMongoCollection } from '../collection'
20
20
21
+ /**
22
+ * A stripped down version of Meteor's Mongo.Cursor, with only the async methods
23
+ */
21
24
export type MinimalMongoCursor < T extends { _id : ProtectedString < any > } > = Pick <
22
25
MongoCursor < T > ,
23
26
'fetchAsync' | 'observeChangesAsync' | 'observeAsync' | 'countAsync'
24
27
// | 'forEach' | 'map' |
25
28
>
26
-
29
+ /**
30
+ * A stripped down version of Meteor's Mongo.Collection, with only the async methods
31
+ */
27
32
export type MinimalMeteorMongoCollection < T extends { _id : ProtectedString < any > } > = Pick <
28
33
Mongo . Collection < T > ,
29
- // | 'find'
30
34
'insertAsync' | 'removeAsync' | 'updateAsync' | 'upsertAsync' | 'rawCollection' | 'rawDatabase' | 'createIndex'
31
35
> & {
32
36
find : ( ...args : Parameters < Mongo . Collection < T > [ 'find' ] > ) => MinimalMongoCursor < T >
You can’t perform that action at this time.
0 commit comments