elapsedMs += currentTimeMillis();
sleep(Math.max(INTERVAL_MS - elapsedMs, 0));
} catch (HttpResponseException e) {
LOG.warn(format("MusicBrainz internal error: %d, %s",
e.getStatusCode(), e.getMessage()));
throw new ApplicationException("MusicBrainz internal error!", e);
} catch (IOException e) {
throw new ApplicationException("MusicBrainz communication failed!", e);
} catch (InterruptedException e) {
LOG.warn("MusicBrainz sleep interrupted!", e);
}
webserviceHistoryService.logWebserviceInvocation(invocation);
return response;