Skip to content

Instantly share code, notes, and snippets.

@pbogunovich
Created June 3, 2013 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbogunovich/5699292 to your computer and use it in GitHub Desktop.
Save pbogunovich/5699292 to your computer and use it in GitHub Desktop.
public void disableCampaignForDailyBudgetReachedIfNeeded(
Constrainable campaign, Long newSpend, Long snapSpentMicros) {
/*
* Checking if campaign is over daily budget. Disable if necessary.
*/
if (!constraintCheckingService.isCampaignDisabled(campaign)
&& constraintCheckingService.isDailyBudgetReached(campaign, newSpend,
snapSpentMicros)) {
disablingService.disableCampaignForDailyBudgetReached(campaign);
LOGGER.debug("Disabling campaign ({}), for daily budget reached",
campaign.getUniqueId());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment