mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00
Fix not logging connection created messages
This commit is contained in:
parent
fd21998486
commit
1795b86e7b
@ -517,18 +517,12 @@ export class Bridge {
|
||||
|
||||
await Promise.all(joinedRooms.map(async (roomId) => {
|
||||
log.debug("Fetching state for " + roomId);
|
||||
let connections: IConnection[];
|
||||
try {
|
||||
connections = await connManager.createConnectionsForRoomId(roomId);
|
||||
await connManager.createConnectionsForRoomId(roomId);
|
||||
} catch (ex) {
|
||||
log.error(`Unable to create connection for ${roomId}`, ex);
|
||||
return;
|
||||
}
|
||||
if (connections.length) {
|
||||
log.info(`Room ${roomId} is connected to: ${connections.join(',')}`);
|
||||
connManager.push(...connections);
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Refactor this to be a connection
|
||||
try {
|
||||
@ -720,8 +714,7 @@ export class Bridge {
|
||||
|
||||
// Only fetch rooms we have no connections in yet.
|
||||
if (!this.connectionManager.isRoomConnected(roomId)) {
|
||||
const connections = await this.connectionManager.createConnectionsForRoomId(roomId);
|
||||
this.connectionManager.push(...connections);
|
||||
await this.connectionManager.createConnectionsForRoomId(roomId);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -260,18 +260,17 @@ export class ConnectionManager {
|
||||
return;
|
||||
}
|
||||
|
||||
public async createConnectionsForRoomId(roomId: string): Promise<IConnection[]> {
|
||||
public async createConnectionsForRoomId(roomId: string) {
|
||||
const state = await this.as.botClient.getRoomState(roomId);
|
||||
const connections: IConnection[] = [];
|
||||
for (const event of state) {
|
||||
try {
|
||||
const conn = await this.createConnectionForState(roomId, new StateEvent(event));
|
||||
log.info(`Room ${roomId} is connected to: ${conn}`);
|
||||
if (conn) { this.push(conn); }
|
||||
} catch (ex) {
|
||||
log.warn(`Failed to create connection for ${roomId}:`, ex);
|
||||
}
|
||||
}
|
||||
return connections;
|
||||
}
|
||||
|
||||
public getConnectionsForGithubIssue(org: string, repo: string, issueNumber: number): (GitHubIssueConnection|GitHubRepoConnection)[] {
|
||||
|
Loading…
x
Reference in New Issue
Block a user