Skip to content

Commit

Permalink
[fix] add Random seconds interval between Public Key & Voter saving
Browse files Browse the repository at this point in the history
  • Loading branch information
TechQuery committed Jan 27, 2025
1 parent 7ccd6b1 commit ff1714a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/controller/Election.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Post
} from 'routing-controllers';
import { ResponseSchema } from 'routing-controllers-openapi';
import { sleep } from 'web-utility';

import {
dataSource,
Expand Down Expand Up @@ -62,6 +63,8 @@ export class ElectionController {
electionName,
jsonWebKey
});
await sleep(Math.random());

await this.voterStore.save({ createdBy, electionName });

return publicKey;
Expand Down

0 comments on commit ff1714a

Please sign in to comment.