Created
September 2, 2015 21:54
-
-
Save alexmchale/1779e3b06afcdeb431f4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $current_quota_allotment = 0; | |
my $current_quota_messages_key = undef; | |
my $current_quota_hourly_messages_key = undef; | |
my $current_quota_hour = undef; | |
my $return_organization_message_allotment = sub { | |
return if ( $current_quota_allotment <= 0 ); | |
# Load the script if it's not already been read. | |
if ( ! defined $request_organization_message_allotment_sha ) { | |
$request_organization_message_allotment_sha = load_lua_script("return_organization_message_allotment"); | |
} | |
# Call the allocator request script. | |
my $result = $redis->evalsha($request_organization_message_allotment_sha, 0, $organization_id, ...); | |
# Return the result. | |
return $result; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment