You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Class below is called when creating a new pool. When two requests are trying to create a healthcheck with the same identifier, it can be duplicated on the DB, causing next requests with same data to fail, as it would return two objects on get().
Need to change code to avoid this from happening. Use lock?
networkapi.healthcheckexpect.models:
class Healthcheck(BaseModel):
def get_create_healthcheck(self, healthcheck):
try:
hc = Healthcheck.objects.get(**healthcheck)
except ObjectDoesNotExist:
hc = Healthcheck(**healthcheck)
hc.save()
The text was updated successfully, but these errors were encountered:
Class below is called when creating a new pool. When two requests are trying to create a healthcheck with the same identifier, it can be duplicated on the DB, causing next requests with same data to fail, as it would return two objects on get().
Need to change code to avoid this from happening. Use lock?
networkapi.healthcheckexpect.models:
class Healthcheck(BaseModel):
def get_create_healthcheck(self, healthcheck):
try:
hc = Healthcheck.objects.get(**healthcheck)
except ObjectDoesNotExist:
hc = Healthcheck(**healthcheck)
hc.save()
The text was updated successfully, but these errors were encountered: