mirror of
https://github.com/stronk-dev/RandomChad.git
synced 2025-07-05 02:35:08 +02:00
✨ split runtimes into cheap and expensive
This commit is contained in:
parent
0069a5f2a3
commit
f80ba6f02b
@ -3,26 +3,30 @@ const testnetAPI = require( './endpoints/testnet' )
|
||||
const mainnetAPI = require( './endpoints/mainnet' )
|
||||
|
||||
// Runtime config
|
||||
const runtime = {
|
||||
const expensive_runtime = {
|
||||
timeoutSeconds: 540,
|
||||
memory: '4GB'
|
||||
}
|
||||
const cheap_runtime = {
|
||||
timeoutSeconds: 540,
|
||||
memory: '512MB'
|
||||
}
|
||||
|
||||
// Testnet endpoint
|
||||
exports.testnetMetadata = functions.runWith( runtime ).https.onRequest( testnetAPI )
|
||||
exports.testnetMetadata = functions.runWith( cheap_runtime ).https.onRequest( testnetAPI )
|
||||
|
||||
// Mainnet endpoint
|
||||
exports.mainnetMetadata = functions.runWith( runtime ).https.onRequest( mainnetAPI )
|
||||
exports.mainnetMetadata = functions.runWith( cheap_runtime ).https.onRequest( mainnetAPI )
|
||||
|
||||
/* ///////////////////////////////
|
||||
// Firestore listeners
|
||||
// /////////////////////////////*/
|
||||
const { handleQueuedRocketeerOutfit } = require( './nft-media/changing-room' )
|
||||
exports.mainnetGenerateOutfitsOnQueue = functions.runWith( runtime ).firestore.document( `mainnetQueueOutfitGeneration/{rocketeerId}` ).onWrite( handleQueuedRocketeerOutfit )
|
||||
exports.rinkebyGenerateOutfitsOnQueue = functions.runWith( runtime ).firestore.document( `rinkebyQueueOutfitGeneration/{rocketeerId}` ).onWrite( handleQueuedRocketeerOutfit )
|
||||
exports.mainnetGenerateOutfitsOnQueue = functions.runWith( expensive_runtime ).firestore.document( `mainnetQueueOutfitGeneration/{rocketeerId}` ).onWrite( handleQueuedRocketeerOutfit )
|
||||
exports.rinkebyGenerateOutfitsOnQueue = functions.runWith( expensive_runtime ).firestore.document( `rinkebyQueueOutfitGeneration/{rocketeerId}` ).onWrite( handleQueuedRocketeerOutfit )
|
||||
|
||||
/* ///////////////////////////////
|
||||
// Daemons
|
||||
// /////////////////////////////*/
|
||||
const { notify_holders_of_changing_room_updates } = require( './integrations/changingroom' )
|
||||
exports.notify_holders_of_changing_room_updates = functions.runWith( runtime ).pubsub.schedule( '30 1 * * *' ).onRun( notify_holders_of_changing_room_updates )
|
||||
exports.notify_holders_of_changing_room_updates = functions.runWith( cheap_runtime ).pubsub.schedule( '30 1 * * *' ).onRun( notify_holders_of_changing_room_updates )
|
Loading…
x
Reference in New Issue
Block a user