Skip to content
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.

Commit

Permalink
don't overwrite existing user
Browse files Browse the repository at this point in the history
  • Loading branch information
montyanderson committed Nov 20, 2019
1 parent 330c0a8 commit e476f25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ router.get('/adduser/:user', async ctx => {
const userExists = await githubUserExists(ctx.params.user);

if(userExists === true) {
const added = await redis.zadd('tracked', -1, ctx.params.user) === 1;
const added = await redis.zadd('tracked', 'NX', -1, ctx.params.user) === 1;
await search.index(ctx.params.user);
ctx.body = added ? 'added' : 'exists';
} else {
Expand Down

0 comments on commit e476f25

Please sign in to comment.