mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge remote-tracking branch 'origin/2650-feature-federation-harmonize-and-sync-modules-of-federation' into 2501-feature-federation-implement-a-graphql-client-to-request-getpublickey
This commit is contained in:
commit
e3284f4659
@ -44,11 +44,10 @@ const lookupResultMock = {
|
||||
token: Buffer.from(TEST_TOPIC),
|
||||
from: {
|
||||
id: Buffer.from('somone'),
|
||||
foreign: true,
|
||||
host: '188.95.53.5',
|
||||
port: 63561,
|
||||
},
|
||||
to: { id: null, foreign: true, host: '83.53.31.27', port: 55723 },
|
||||
to: { id: null, host: '83.53.31.27', port: 55723 },
|
||||
peers: [
|
||||
{
|
||||
publicKey: Buffer.from('some-public-key'),
|
||||
|
||||
@ -189,11 +189,9 @@ export const startDHT = async (topic: string): Promise<void> => {
|
||||
}
|
||||
|
||||
async function writeHomeCommunityEnries(pubKey: any): Promise<CommunityApi[]> {
|
||||
const homeApiVersions: CommunityApi[] = Object.values(ApiVersionType).map(function (
|
||||
apiEnum,
|
||||
idx,
|
||||
) {
|
||||
const port = Number.parseInt(CONFIG.FEDERATION_COMMUNITY_API_PORT) + idx + 1
|
||||
const homeApiVersions: CommunityApi[] = Object.values(ApiVersionType).map(function (apiEnum) {
|
||||
const port =
|
||||
Number.parseInt(CONFIG.FEDERATION_COMMUNITY_API_PORT) + Number(apiEnum.replace('_', ''))
|
||||
const comApi: CommunityApi = {
|
||||
api: apiEnum,
|
||||
url: CONFIG.FEDERATION_COMMUNITY_URL + ':' + port.toString() + '/api/',
|
||||
@ -202,10 +200,7 @@ async function writeHomeCommunityEnries(pubKey: any): Promise<CommunityApi[]> {
|
||||
})
|
||||
try {
|
||||
// first remove privious existing homeCommunity entries
|
||||
const homeComs = await DbCommunity.find({ foreign: false })
|
||||
if (homeComs.length > 0) {
|
||||
await DbCommunity.remove(homeComs)
|
||||
}
|
||||
DbCommunity.createQueryBuilder().delete().where({ foreign: false }).execute()
|
||||
|
||||
homeApiVersions.forEach(async function (homeApi) {
|
||||
const homeCom = new DbCommunity()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user