fix: cleanup commented out dead code (#14188)

This commit is contained in:
Chakru 2025-07-25 19:50:30 +05:30 committed by GitHub
parent 778f0f8d1c
commit b486bccbb3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -154,56 +154,6 @@ public class TrackingService {
}
}
// TODO: No callers: Remove post review
/*
public void track(
@Nonnull final String eventName,
@Nonnull final OperationContext opContext,
@Nullable final Authenticator authenticator,
@Nullable final EntityClient entityClient) {
if (mixpanelAPI == null || messageBuilder == null) {
log.warn("Mixpanel tracking is not enabled. Skipping event: {}", eventName);
return;
}
try {
final String actorId = opContext.getActorContext().getActorUrn().toString();
// Create the event message using MessageBuilder
JSONObject message = messageBuilder.event(actorId, eventName, new JSONObject());
// Create properties object if it doesn't exist
JSONObject properties;
if (message.has("properties")) {
properties = message.getJSONObject("properties");
} else {
properties = new JSONObject();
message.put("properties", properties);
}
// Add properties to the event
properties.put("distinct_id", actorId);
properties.put("actor", actorId);
properties.put("version", _gitVersion.getVersion());
properties.put("time", System.currentTimeMillis() / 1000L);
// Sanitize the properties
JSONObject sanitizedProperties = sanitizeEvent(properties);
if (sanitizedProperties != null) {
message.put("properties", sanitizedProperties);
}
// log the message
log.info("Sending event {} to Mixpanel: {}", eventName, message.toString());
mixpanelAPI.sendMessage(message);
log.debug("Successfully sent event {} to Mixpanel", eventName);
} catch (Exception e) {
log.warn("Failed to track event: {}", eventName, e);
}
}
*/
/**
* Parse a timestamp from various formats (numeric or string) and convert it to epoch milliseconds
*