Skip to content

Commit 699d865

Browse files
build(firestore-counter): build js files
1 parent 25975cc commit 699d865

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

firestore-counter/functions/lib/index.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ exports.controllerCore = functions.handler.pubsub.topic.onPublish(() => __awaite
5454
/**
5555
* Backwards compatible HTTPS function
5656
*/
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* () {
5858
if (!pubsub) {
5959
pubsub = new pubsub_1.PubSub();
6060
}
@@ -71,9 +71,7 @@ exports.controller = functions.https.onRequest((req, res) => __awaiter(void 0, v
7171
* ControllerCore is monitoring these metadata documents to detect overload that requires
7272
* resharding and to detect failed workers that need poking.
7373
*/
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* () {
7775
// stop worker if document got deleted
7876
if (!change.after.exists)
7977
return;
@@ -85,9 +83,7 @@ exports.worker = functions.firestore
8583
* limited to one concurrent run at the time. This helps reduce latency for workloads
8684
* that are below the threshold for workers.
8785
*/
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* () {
9187
const metadocRef = firestore.doc(process.env.INTERNAL_STATE_PATH);
9288
const controller = new controller_1.ShardedCounterController(metadocRef, SHARDS_COLLECTION_ID);
9389
yield controller.aggregateContinuously({ start: "", end: "" }, 200, 60000);

0 commit comments

Comments
 (0)