Skip to content

Commit dd1efe2

Browse files
author
Kyle Rockman
committed
don't send requests if the batch is empty
1 parent b4e23c8 commit dd1efe2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Mixpanel/MixpanelManager.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ private IEnumerator DoRequest(string url, PersistentQueue queue, int retryCount
122122
batch.Add(JsonUtility.FromJson<Value>(Encoding.UTF8.GetString(data)));
123123
++count;
124124
}
125-
125+
// If the batch is empty don't send the request
126+
if (count == 0) yield break;
126127
string payload = Convert.ToBase64String(Encoding.UTF8.GetBytes(batch.ToString()));
127128
if (MixpanelSettings.Instance.ShowDebug) Debug.Log($"[Mixpanel] Sending Request - '{url}' with payload '{payload}'");
128129
WWWForm form = new WWWForm();

0 commit comments

Comments
 (0)