Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
fix issue deleting proxy from storage tables (#932)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmc-msft authored May 26, 2021
1 parent 8b74d08 commit c107a04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/api-service/__app__/onefuzzlib/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ def stopping(self) -> None:
self.stopped()

def stopped(self) -> None:
self.set_state(VmState.stopped)
logging.info(PROXY_LOG_PREFIX + "removing proxy: %s", self.region)
send_event(EventProxyDeleted(region=self.region, proxy_id=self.proxy_id))
self.delete()

def is_outdated(self) -> bool:
Expand Down Expand Up @@ -303,10 +305,6 @@ def get_or_create(cls, region: Region) -> Optional["Proxy"]:
send_event(EventProxyCreated(region=region, proxy_id=proxy.proxy_id))
return proxy

def delete(self) -> None:
super().delete()
send_event(EventProxyDeleted(region=self.region, proxy_id=self.proxy_id))

def set_state(self, state: VmState) -> None:
if self.state == state:
return
Expand Down
2 changes: 1 addition & 1 deletion src/api-service/__app__/timer_proxy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def main(mytimer: func.TimerRequest, dashboard: func.Out[str]) -> None: # noqa:
)
process_state_updates(proxy)

if proxy.is_outdated():
if proxy.state != VmState.stopped and proxy.is_outdated():
proxy.outdated = True
proxy.save()

Expand Down

0 comments on commit c107a04

Please sign in to comment.