Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
smradius
smradius
Commits
d0d9e46b
Commit
d0d9e46b
authored
Feb 04, 2017
by
Nigel Kukard
Browse files
Added more debugging for when auto-topups are not eligble
parent
abb700aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/smradius/modules/features/mod_feature_capping.pm
View file @
d0d9e46b
...
...
@@ -681,8 +681,17 @@ sub _doAutoTopup
# Default to an auto-topup threshold of the topup amount divided by two if none has been provided
$autoTopupThreshold
//
=
floor
(
$autoTopupAmount
/
2
);
# Check if we're still within our usage limit
return
if
(
$usageLimit
+
$autoTopupsAdded
-
$accountingUsage
<
$autoTopupThreshold
);
# Check if we're still within our usage limit and return
if
((
$usageLimit
+
$autoTopupsAdded
-
$accountingUsage
)
>
$autoTopupThreshold
)
{
$server
->
log
(
LOG_DEBUG
,'
[MOD_FEATURE_CAPPING] SMRadius-AutoToup-%s: CHECK => usageLimit(%s) + autoTopupsAdded(%s) -
'
.
'
accountingUsage(%s) < autoTopupThreshold(%s) = not eligble for auto-topup yet
',
$typeKey
,
$usageLimit
,
$autoTopupsAdded
,
$accountingUsage
,
$autoTopupThreshold
);
return
;
}
else
{
$server
->
log
(
LOG_DEBUG
,'
[MOD_FEATURE_CAPPING] SMRadius-AutoToup-%s: CHECK => usageLimit(%s) + autoTopupsAdded(%s) -
'
.
'
accountingUsage(%s) < autoTopupThreshold(%s) = eligble, processing
',
$typeKey
,
$usageLimit
,
$autoTopupsAdded
,
$accountingUsage
,
$autoTopupThreshold
);
}
# Check the difference between our accounting usage and our usage limit
my
$usageDelta
=
$accountingUsage
-
$usageLimit
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment