Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

min_day doesn't seem to be respected with multi-card setup in burst mode #22

Closed
kevin-david opened this issue Jun 7, 2020 · 2 comments

Comments

@kevin-david
Copy link
Contributor

kevin-david commented Jun 7, 2020

I have 3 cards configured like this:

mode: burst
hide_web_browser: true
notify_failure:  <snip>

deba:
  amazon_gift_card_reload:
    enabled: True
    dry_run: False
    total_purchases: 10
    amount_min: 50
    amount_max: 50
    usr:  <snip>
    psw:  <snip>
    close_browser: no
    card:  <snip>
    burst_count: 3
    timing:
      min_day: 2
      max_day: 14
      burst:
        min_gap: 79200
        time_variance: 14400
      spread:
        min_gap: 7200
        time_variance: 1440

debb:
  amazon_gift_card_reload:
    enabled: True
    dry_run: False
    total_purchases: 10
    close_browser: no
    amount_min: 50
    amount_max: 50
    usr:  <snip>
    psw:  <snip>
    card:  <snip>
    burst_count: 3
    timing:
      min_day: 2
      max_day: 14
      burst:
        count: 1
        min_gap: 79200
        time_variance: 14400
      spread:
        min_gap: 7200
        time_variance: 1440

bc:
  amazon_gift_card_reload:
    enabled: True
    dry_run: False
    total_purchases: 1
    amount_min: 99
    amount_max: 99
    usr:  <snip>
    psw:  <snip>
    card: <snip>
    close_browser: no
    burst_count: 1
    timing:
      min_day: 9
      max_day: 27
      burst:
        count: 1
        min_gap: 79200
        time_variance: 14400
      spread:
        min_gap: 7200
        time_variance: 1440

Just ran burst mode and it made the purchase for 0.99 a few days early. Also had this fun error!

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "debbit.py", line 127, in burst_loop
    burst_gap = get_burst_min_gap(merchant, cur_purchase_count, now) + random.randint(0, int(merchant.burst_time_variance))
  File "debbit.py", line 148, in get_burst_min_gap
    dynamic_burst_min_gap = int(remaining_secs_in_month / 4 / remaining_purchase_count * merchant.burst_count)
ZeroDivisionError: float division by zero

I think it was working fine in spread mode, but I was having problems with running from source on Windows and Mac gave me a better error message (#21) so I was trying that out :)

@kevin-david
Copy link
Contributor Author

Just noticed that I should replace timing: with advanced: from https://jakehilborn.github.io/debbit/, perhaps? Still a pretty strange error message!

@jakehilborn
Copy link
Owner

Yes, advanced is the right key now. Sorry I've been refactoring and changing things quite a lot while trying to get a 2.0 release out. Eventually the documentation and the code will match 😅

Thanks for pointing out the divide by zero error. I fixed that and pushed it to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants