I'm using the v3 API to pull a list of participants for an event record. The call I'm making is:
$result = civicrm_api3( 'participant', 'get', array( 'event_id' => $event_id, 'options' => array( 'limit' => 100, ), ) );
Usually, this works fine and pulls the participant information that I need. However, sometimes it will pull zero results (which is incorrect) but, on refreshing the theme page that displays the data, it will show the participants. It's like the first time through gets no results but primes the second try to be correct. It does not show zero records after the refresh, at least for a while. I cannot regularly recreate this error. As soon as I start pulling down participant records over and over, I don't see the problem show up.
I know this is not a lot to go on but I'm not sure what else to check or how to reliably reproduce this in a way to show off the issue.
Is there a different way to pull participants? Or is this potentially something amiss with CiviCRM?