Skip to content
GitLab
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
b60935bf
Commit
b60935bf
authored
Feb 04, 2017
by
Nigel Kukard
Browse files
Fixed the threshold use to determine when to add an auto-topup
parent
e66aaa7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/smradius/modules/features/mod_feature_capping.pm
View file @
b60935bf
# Capping support
# Copyright (C) 2007-201
6
, AllWorldIT
# Copyright (C) 2007-201
7
, AllWorldIT
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
...
...
@@ -668,7 +668,7 @@ sub _doAutoTopup
$autoTopupThreshold
//
=
floor
(
$autoTopupAmount
/
2
);
# Check if we're still within our usage limit
return
if
(
$
accountingUsage
+
$autoTopup
Threshol
d
<
$
usageLimit
+
$autoTopup
sAdde
d
);
return
if
(
$
usageLimit
+
$autoTopup
sAdde
d
-
$
accountingUsage
<
$autoTopup
Threshol
d
);
# 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
.
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