diff --git a/functions/index.js b/functions/index.js index abff93c..02a5e61 100644 --- a/functions/index.js +++ b/functions/index.js @@ -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 ) \ No newline at end of file +exports.notify_holders_of_changing_room_updates = functions.runWith( cheap_runtime ).pubsub.schedule( '30 1 * * *' ).onRun( notify_holders_of_changing_room_updates ) \ No newline at end of file