Skip to content

Commit

Permalink
Fix calculate user price per hour (#2763)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmahmouali committed Mar 14, 2021
1 parent 68e560f commit d183ed6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jumpscale/packages/vdc/billing.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def transfer_prepaid_to_provision_wallet():
prepaid_wallet = vdc_instance.prepaid_wallet
provision_wallet = vdc_instance.provision_wallet
tft = prepaid_wallet._get_asset("TFT")
hourly_amount = vdc_instance.calculate_spec_price() * 60 * 60
hourly_amount = vdc_instance.calculate_spec_price() / (24 * 30)
j.logger.info(
f"starting the hourly transaction from prepaid wallet to provision wallet with total hourly amount {hourly_amount}"
)
Expand Down
2 changes: 1 addition & 1 deletion jumpscale/packages/vdc/services/fund_prices_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def job(self):
for vdc_name in VDCFACTORY.list_all():
vdc_instance = VDCFACTORY.find(vdc_name)
vdc_instance.load_info()
vdc_spec_price = vdc_instance.calculate_spec_price() # user price
vdc_spec_price = vdc_instance.calculate_spec_price() / (24 * 30) # user price
# check if vdc in grace period
if vdc_instance.is_blocked or vdc_instance.is_empty():
j.logger.info(f"FUND PRICES DIFF: VDC {vdc_instance.instance_name} is empty or in grace period")
Expand Down

0 comments on commit d183ed6

Please sign in to comment.