Skip to content

Commit

Permalink
Made requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fmcubium committed Apr 1, 2024
1 parent 674a0e2 commit 24ca5ca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,6 @@ build
# Other
.env
build/

# Firebase Secrets
.firebase-secrets.json
8 changes: 6 additions & 2 deletions server/src/actions/deleter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ export const scheduleCron = () => {
q.on('value', (querySnapshot)=> {
querySnapshot.forEach(async (doc) => {
//Delete the doc here
console.log(doc.id)
await doc.ref.delete()
console.log(doc.uid)
await doc.ref.delete().then(() => {
console.log("Document successfully deleted!")
}).catch((error) => {
console.error("Error removing document:", error)
})
})
})
})
Expand Down
6 changes: 3 additions & 3 deletions server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ const io = new Server(socketServer, {
},
});

// Begin searching and collecting Garbage (old messages)
scheduleCron();

// Firebase JWT Authorization Custom Middleware
io.use(async (socket, next) => {
const token = socket.handshake.auth.token;
Expand Down Expand Up @@ -344,6 +341,9 @@ app.listen(express_port, () => {
);
});

// Begin searching and collecting Garbage (old messages)
scheduleCron();

// Some old API routes are commented out for now due to breaking type changes.

// REST functions
Expand Down

0 comments on commit 24ca5ca

Please sign in to comment.