Skip to content

Commit

Permalink
Remove inactive user (more thant 1 year without connect) in cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Alza committed Jul 25, 2024
1 parent 561d39c commit 9eb5a1d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion translation-app-assessment/backend/cleanup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const express = require('express')
const bodyParser = require('body-parser')
const Moment = require('moment')
const firebaseAdmin = require('firebase-admin')
const fs = require('fs');

const firebaseConfig = JSON.parse(fs.readFileSync('/etc/secrets/firebase-config.json', 'utf8'));
const Monitoring = require('@google-cloud/monitoring')

// Init express.js app
Expand All @@ -30,7 +33,7 @@ app.use(cors(corsOptions));
// Init project and services
const projectId = process.env.GCP_PROJECT
firebaseAdmin.initializeApp({
credential: firebaseAdmin.credential.applicationDefault()
credential: firebaseAdmin.credential.cert(firebaseConfig)
});
const firestore = firebaseAdmin.firestore()
// Function to write monitoring "heartbeat" that cleanup has run
Expand Down

0 comments on commit 9eb5a1d

Please sign in to comment.