@@ -54,7 +54,7 @@ exports.controllerCore = functions.handler.pubsub.topic.onPublish(() => __awaite
54
54
/**
55
55
* Backwards compatible HTTPS function
56
56
*/
57
- exports . controller = functions . https . onRequest ( ( req , res ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
57
+ exports . controller = functions . handler . https . onRequest ( ( req , res ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
58
58
if ( ! pubsub ) {
59
59
pubsub = new pubsub_1 . PubSub ( ) ;
60
60
}
@@ -71,9 +71,7 @@ exports.controller = functions.https.onRequest((req, res) => __awaiter(void 0, v
71
71
* ControllerCore is monitoring these metadata documents to detect overload that requires
72
72
* resharding and to detect failed workers that need poking.
73
73
*/
74
- exports . worker = functions . firestore
75
- . document ( process . env . INTERNAL_STATE_PATH + WORKERS_COLLECTION_ID + "/{workerId}" )
76
- . onWrite ( ( change , context ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
74
+ exports . worker = functions . handler . firestore . document . onWrite ( ( change , context ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
77
75
// stop worker if document got deleted
78
76
if ( ! change . after . exists )
79
77
return ;
@@ -85,9 +83,7 @@ exports.worker = functions.firestore
85
83
* limited to one concurrent run at the time. This helps reduce latency for workloads
86
84
* that are below the threshold for workers.
87
85
*/
88
- exports . onWrite = functions . firestore
89
- . document ( "/{collection}/{**}/_counter_shards_/{shardId}" )
90
- . onWrite ( ( change , context ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
86
+ exports . onWrite = functions . handler . firestore . document . onWrite ( ( change , context ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
91
87
const metadocRef = firestore . doc ( process . env . INTERNAL_STATE_PATH ) ;
92
88
const controller = new controller_1 . ShardedCounterController ( metadocRef , SHARDS_COLLECTION_ID ) ;
93
89
yield controller . aggregateContinuously ( { start : "" , end : "" } , 200 , 60000 ) ;
0 commit comments