proxies: handle origin destruction
This commit is contained in:
parent
7747461e60
commit
21a5d41e8c
2 changed files with 6 additions and 1 deletions
|
@ -25,7 +25,7 @@ def mirror_sites():
|
|||
"url": a.url
|
||||
} for a in x.proxies if
|
||||
a.url is not None and not a.deprecated and not a.destroyed and a.provider == "cloudfront"
|
||||
]} for x in Origin.query.order_by(Origin.domain_name).all()
|
||||
]} for x in Origin.query.order_by(Origin.domain_name).all() if x.destroyed is None
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
@ -89,6 +89,11 @@ class Origin(AbstractConfiguration):
|
|||
"updated": self.updated
|
||||
}
|
||||
|
||||
def destroy(self):
|
||||
super().destroy()
|
||||
for proxy in self.proxies:
|
||||
proxy.destroy()
|
||||
|
||||
def __repr__(self):
|
||||
return '<Origin %r>' % self.domain_name
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue