Skip to content

Commit bdc05e8

Browse files
committed
rm unnecessary code snippet
1 parent 4ffd70c commit bdc05e8

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

packages/core/src/lib/cache-layer/cacheLayerRefresher.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ export class CacheLayerRefresher implements ICacheLayerRefresher {
100100
) {
101101
const { urlPath } = schema;
102102
const { sql } = cache;
103-
// if fn is not a function, return
104103
let refreshResult = RefreshResult.SUCCESS;
105104
const now = moment.utc().format('YYYY-MM-DD HH:mm:ss');
106105
const templateName = schema.templateSource.replace('/', '_');

packages/core/src/lib/loggers/httpLogger.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
VulcanInternalExtension,
88
} from '../../models/extensions';
99
import axios, { AxiosRequestHeaders } from 'axios';
10-
import { ConnectionConfig } from '../utils/url';
10+
import { ConnectionConfig, getUrl } from '../utils/url';
1111

1212
export interface HttpLoggerConfig {
1313
connection?: HttpLoggerConnectionConfig;
@@ -29,7 +29,7 @@ export class HttpLogger extends BaseActivityLogger<HttpLoggerConfig> {
2929
throw new Error('Http logger connection should be provided');
3030
}
3131
const headers = option.connection.headers;
32-
const url = this.getUrl(option.connection);
32+
const url = getUrl(option.connection);
3333
try {
3434
// get connection info from option and use axios to send a post requet to the endpoint
3535
await this.sendActivityLog(url, payload, headers);
@@ -42,20 +42,13 @@ export class HttpLogger extends BaseActivityLogger<HttpLoggerConfig> {
4242
}
4343
}
4444

45-
protected sendActivityLog = async (
45+
protected async sendActivityLog(
4646
url: string,
4747
payload: any,
4848
headers: AxiosRequestHeaders | undefined
49-
): Promise<void> => {
49+
): Promise<void> {
5050
await axios.post(url, payload, {
5151
headers: headers,
5252
});
53-
};
54-
55-
protected getUrl = (connection: HttpLoggerConnectionConfig): string => {
56-
const { ssl, host, port, path = '' } = connection;
57-
const protocol = ssl ? 'https' : 'http';
58-
const urlbase = `${protocol}://${host}:${port}`;
59-
return new URL(path, urlbase).href;
60-
};
53+
}
6154
}

packages/core/src/lib/utils/url.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
export interface ConnectionConfig {
2-
ssl?: boolean | undefined;
3-
host?: string | undefined;
2+
ssl?: boolean;
3+
host?: string;
44
port?: number | string;
5-
path?: string | undefined;
5+
path?: string;
66
}
77

88
export const getUrl = (connection: ConnectionConfig): string => {

0 commit comments

Comments
 (0)