This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.verifySubscriptionAndroid = functions.pubsub.schedule('0 2 * * 0').timeZone('Asia/Tokyo').onRun(async (context) => { | |
// 該当レシートを検索 | |
const now = Date.now(); | |
const termTime = 24 * 60 * 60 * 1000; // 24時間間隔でチェックするため | |
const minTime = now - termTime; | |
const receiptsSnapshot = await admin.firestore().collectionGroup("receipts") | |
.where("expires_date_ms", "<=", now) | |
.where("expires_date_ms", ">", minTime) | |
.orderBy("expires_date_ms") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.verifySubscriptionIos = functions.pubsub.schedule('0 1 * * 0').timeZone('Asia/Tokyo').onRun(async (context) => { | |
// 該当レシートを検索 | |
const now = Date.now(); | |
const termTime = 24 * 60 * 60 * 1000; // 24時間間隔でチェックするため | |
const minTime = now - termTime; | |
const receiptsSnapshot = await admin.firestore().collectionGroup("receipts") | |
.where("expires_date_ms", "<=", now) | |
.where("expires_date_ms", ">", minTime) | |
.orderBy("expires_date_ms") |
OlderNewer