Skip to content

Commit d183ed6

Browse files
authored
Fix calculate user price per hour (#2763)
1 parent 68e560f commit d183ed6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

jumpscale/packages/vdc/billing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def transfer_prepaid_to_provision_wallet():
2727
prepaid_wallet = vdc_instance.prepaid_wallet
2828
provision_wallet = vdc_instance.provision_wallet
2929
tft = prepaid_wallet._get_asset("TFT")
30-
hourly_amount = vdc_instance.calculate_spec_price() * 60 * 60
30+
hourly_amount = vdc_instance.calculate_spec_price() / (24 * 30)
3131
j.logger.info(
3232
f"starting the hourly transaction from prepaid wallet to provision wallet with total hourly amount {hourly_amount}"
3333
)

jumpscale/packages/vdc/services/fund_prices_diff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def job(self):
2121
for vdc_name in VDCFACTORY.list_all():
2222
vdc_instance = VDCFACTORY.find(vdc_name)
2323
vdc_instance.load_info()
24-
vdc_spec_price = vdc_instance.calculate_spec_price() # user price
24+
vdc_spec_price = vdc_instance.calculate_spec_price() / (24 * 30) # user price
2525
# check if vdc in grace period
2626
if vdc_instance.is_blocked or vdc_instance.is_empty():
2727
j.logger.info(f"FUND PRICES DIFF: VDC {vdc_instance.instance_name} is empty or in grace period")

0 commit comments

Comments
 (0)