Skip to content

Commit 54b9ece

Browse files
committed
fix: Fix when to check connection
Since all sources can now control if they need to check connection or not do not restrict to just those that can poll
1 parent 3351365 commit 54b9ece

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

src/backend/sources/AbstractSource.ts

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -149,23 +149,21 @@ export default abstract class AbstractSource implements Authenticatable {
149149
}
150150

151151
public async checkConnection() {
152-
if (this.canPoll) {
153-
try {
154-
const res = await this.doCheckConnection();
155-
if (res === undefined) {
156-
this.logger.debug('Connection check was not required.');
157-
this.connectionOK = null;
158-
return;
159-
} else if (res === true) {
160-
this.logger.verbose('Connection check succeeded');
161-
} else {
162-
this.logger.verbose(`Connection check succeeded => ${res}`);
163-
}
164-
this.connectionOK = true;
165-
} catch (e) {
166-
this.connectionOK = false;
167-
throw new ErrorWithCause('Communicating with upstream service failed', {cause: e});
152+
try {
153+
const res = await this.doCheckConnection();
154+
if (res === undefined) {
155+
this.logger.debug('Connection check was not required.');
156+
this.connectionOK = null;
157+
return;
158+
} else if (res === true) {
159+
this.logger.verbose('Connection check succeeded');
160+
} else {
161+
this.logger.verbose(`Connection check succeeded => ${res}`);
168162
}
163+
this.connectionOK = true;
164+
} catch (e) {
165+
this.connectionOK = false;
166+
throw new ErrorWithCause('Communicating with upstream service failed', {cause: e});
169167
}
170168
}
171169

0 commit comments

Comments
 (0)