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

fix issue deleting proxy from storage tables #932

Merged
merged 3 commits into from
May 26, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 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,10 @@ def stopping(self) -> None:
self.stopped()

def stopped(self) -> None:
if self.state != VmState.stopped:
bmc-msft marked this conversation as resolved.
Show resolved Hide resolved
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))
ranweiler marked this conversation as resolved.
Show resolved Hide resolved
self.delete()

def is_outdated(self) -> bool:
Expand Down Expand Up @@ -303,10 +306,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