Skip to content

Commit

Permalink
Merge pull request #54 from zooniverse/pause-db-updates
Browse files Browse the repository at this point in the history
Pause db updates
  • Loading branch information
zwolf authored Dec 15, 2023
2 parents 4afd487 + 1942bb1 commit 9dbde40
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ var sns_client = SNSClient(auth, function (err, message) {
if (!!email) {
// https://docs.aws.amazon.com/ses/latest/dg/notification-contents.html#bounce-types
if (report.notificationType === 'Complaint' || report.bounce.bounceType == 'Permanent') {
pg_pool.connect(function (err, client, done) {
updatePanoptes(err, client, done, email, report);
});
console.log("Unsubscribed " + email + "(" + report.notificationType + "); changed 0 rows");

// Temporarily pause db updates
// pg_pool.connect(function (err, client, done) {
// updatePanoptes(err, client, done, email, report);
// });
} else {
console.log("Ignoring non-permanent bounce for", email);
}
Expand All @@ -67,7 +70,7 @@ var app = express();
app.get('/', function (req, res) {
res.status(200).end();
});


app.post('/unsub', sns_client);

Expand Down

0 comments on commit 9dbde40

Please sign in to comment.