def METHOD_NAME(self, code):
    if self.outpost and self.last_uid:
        state = OutpostState.for_instance_uid(self.outpost, self.last_uid)
        if self.channel_name in state.channel_ids:
            state.channel_ids.remove(self.channel_name)
            state.save()
        GAUGE_OUTPOSTS_CONNECTED.labels(
            outpost=self.outpost.name,
            uid=self.last_uid,
            expected=self.outpost.config.kubernetes_replicas,
        ).dec()
    self.logger.debug(
        "removed outpost instance from cache",
        instance_uuid=self.last_uid,
    )