Skip to content

Commit

Permalink
Delete unused proxies (#840)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChewingGlass authored Feb 26, 2025
1 parent 56147c9 commit 8be9696
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/helium-vote-service/src/repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ export const readProxiesAndUpsert = async () => {
"utf-8"
);
const proxies = JSON.parse(proxiesJson);
const existingProxiesNotInRepo = await Proxy.findAll({
where: {
name: {
[Op.notIn]: proxies.map((proxy) => proxy.name),
},
},
});
for (const proxy of existingProxiesNotInRepo) {
await proxy.destroy();
}
for (const proxy of proxies) {
const existingProxy = await Proxy.findOne({
where: {
Expand Down

0 comments on commit 8be9696

Please sign in to comment.