Handle telemetry disabled (#9517)

Signed-off-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
This commit is contained in:
Shrikant Sharat Kandula 2021-12-02 16:58:26 +05:30 committed by GitHub
parent eed6ad9166
commit cd624982b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,6 +36,10 @@ public class SegmentConfig {
@Bean
public Analytics analyticsRunner() {
if (commonConfig.isTelemetryDisabled()) {
return null;
}
final String analyticsWriteKey = commonConfig.isCloudHosting() ? writeKey : ceKey;
if (StringUtils.isEmpty(analyticsWriteKey)) {
// We don't have the Segment Key, returning `null` here will disable analytics calls from AnalyticsService.