def on_close(self, *args, **kwargs):
if self.connection is not None:<EOL><INDENT>del self.pgworker.connections[self.connection.pk]<EOL>self.connection.delete()<EOL>self.connection = None<EOL><DEDENT>signals.request_finished.send(sender=self.__class__)<EOL>safe_call(self.logger.info, '<STR_LIT>', self, args or '<STR_LIT>')<EOL>
Handle closing of websocket connection.