Libraries refactor and add some sinks #4
|
@ -563,7 +563,7 @@ class Agora(object):
|
||||||
min_margin_ad_not_us = min(ads_without_us, key=lambda x: x[3])
|
min_margin_ad_not_us = min(ads_without_us, key=lambda x: x[3])
|
||||||
self.log.debug("Min margin ad not us: {x}", x=min_margin_ad_not_us)
|
self.log.debug("Min margin ad not us: {x}", x=min_margin_ad_not_us)
|
||||||
# Lowball the lowest ad that is not ours
|
# Lowball the lowest ad that is not ours
|
||||||
lowball_lowest_not_ours = min_margin_ad_not_us[3] - 0.001
|
lowball_lowest_not_ours = min_margin_ad_not_us[3] # - 0.005
|
||||||
self.log.debug("Lowball lowest not ours: {x}", x=lowball_lowest_not_ours)
|
self.log.debug("Lowball lowest not ours: {x}", x=lowball_lowest_not_ours)
|
||||||
|
|
||||||
# Check if the username field of the cheapest ad matches ours
|
# Check if the username field of the cheapest ad matches ours
|
||||||
|
@ -599,7 +599,7 @@ class Agora(object):
|
||||||
return float(settings.Agora.MaxMargin)
|
return float(settings.Agora.MaxMargin)
|
||||||
# Find cheapest ad above our min that is not us
|
# Find cheapest ad above our min that is not us
|
||||||
cheapest_ad = min(ads_above_our_min_not_us, key=lambda x: x[3])
|
cheapest_ad = min(ads_above_our_min_not_us, key=lambda x: x[3])
|
||||||
cheapest_ad_margin = cheapest_ad[3] - 0.001
|
cheapest_ad_margin = cheapest_ad[3] # - 0.005
|
||||||
if cheapest_ad_margin > float(settings.Agora.MaxMargin):
|
if cheapest_ad_margin > float(settings.Agora.MaxMargin):
|
||||||
self.log.debug("Cheapest ad not ours more than MaxMargin")
|
self.log.debug("Cheapest ad not ours more than MaxMargin")
|
||||||
return float(settings.Agora.MaxMargin)
|
return float(settings.Agora.MaxMargin)
|
||||||
|
@ -810,7 +810,7 @@ class Agora(object):
|
||||||
rtrn = self.agora._api_call(api_method=f"contact_release/{contact_id}", http_method="POST", query_values=payload)
|
rtrn = self.agora._api_call(api_method=f"contact_release/{contact_id}", http_method="POST", query_values=payload)
|
||||||
|
|
||||||
# Check if we can withdraw funds
|
# Check if we can withdraw funds
|
||||||
self.withdraw_funds()
|
# self.withdraw_funds()
|
||||||
|
|
||||||
return rtrn
|
return rtrn
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue