Page MenuHomePhabricator

[keyserver] cron job to sync reserved usernames
ClosedPublic

Authored by varun on Jun 27 2023, 7:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jan 13, 7:11 PM
Unknown Object (File)
Mon, Jan 13, 2:35 PM
Unknown Object (File)
Sun, Dec 29, 5:59 AM
Unknown Object (File)
Sun, Dec 29, 5:59 AM
Unknown Object (File)
Sun, Dec 29, 5:59 AM
Unknown Object (File)
Sun, Dec 29, 5:58 AM
Unknown Object (File)
Sun, Dec 29, 5:56 AM
Unknown Object (File)
Dec 7 2024, 5:53 PM
Subscribers

Details

Summary

daily cron job to send all the usernames from ashoat's keyserver to the identity service.

the logic here is very similar to the logic added to the account-creator.js

Depends on D8330

Test Plan

Modified cron job schedule to force a run and observed that usernames were added to the identity service's reserved usernames table locally

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun requested review of this revision.Jun 27 2023, 8:03 AM

Instead of syncing it using chron, can't we call the API as a part of user registration / account deletion?

In D8331#245829, @tomek wrote:

Instead of syncing it using chron, can't we call the API as a part of user registration / account deletion?

We do that as well in D8300. This change is just for initial syncing and then in case of a network failure or identity service issue

ashoat added inline comments.
keyserver/src/cron/add-reserved-usernames.js
11 ↗(On Diff #28174)

Let's name it more precisely

keyserver/src/cron/cron.js
96 ↗(On Diff #28174)

It seems like we'll need to make sure this only runs on my keyserver. Can you create a follow-up Linear task before landing for this? If you don't already have a parent task for follow-ups, you can create one and add the new task as a child

103 ↗(On Diff #28174)
This revision is now accepted and ready to land.Jun 28 2023, 5:42 PM
This revision is now accepted and ready to land.Jul 3 2023, 9:42 PM