unoffical wafrn mirror wafrn.net
atproto social-network activitypub
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

improved index cleaning thingg

+13 -13
+13 -13
packages/backend/websocket.ts
··· 85 85 const users = await User.findAll({ 86 86 where: { 87 87 banned: { 88 - [Op.ne]: true 88 + [Op.ne]: true, 89 89 }, 90 90 email: { 91 91 [Op.ne]: null, 92 92 }, 93 - } 94 - }) 95 - const adminUser = await getAdminUser() 96 - await Promise.all(users.map(x => follow(x.id, adminUser.id))) 97 - } catch { } 93 + }, 94 + }); 95 + const adminUser = await getAdminUser(); 96 + await Promise.all(users.map((x) => follow(x.id, adminUser.id))); 97 + } catch {} 98 98 } 99 + let postIndexes = await queryInterface.showIndex("posts"); 99 100 100 - clearDuplicatedBskyUris().then(async (res) => { 101 - let postIndexes = await queryInterface.showIndex("posts"); 102 - if ( 103 - !(postIndexes as Array<any>).some((index) => index.name === "post_bsky_uri") 104 - ) { 101 + if ( 102 + !(postIndexes as Array<any>).some((index) => index.name === "post_bsky_uri") 103 + ) { 104 + clearDuplicatedBskyUris().then(async (res) => { 105 105 // well turns out that we dont have indexes 106 106 // we have cleaned duplicated before. if a duplicate apears here we just crash and do it again :3 107 107 await queryInterface.sequelize.query( 108 108 `CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS post_bsky_uri ON "posts" ("bskyUri");` 109 109 ); 110 - } 111 - }); 110 + }); 111 + } 112 112 113 113 async function clearDuplicatedBskyUris(): Promise<boolean> { 114 114 let duplicatedURIs: any = await queryInterface.sequelize.query(