Ejemplo n.º 1
0
    def Ping(self, request, context):
        self._last_ping = datetime.now()
        self._stats_dialog.update(request.stats)

        if request.stats.daemon_version != version:
            self._version_warning_trigger.emit(request.stats.daemon_version,
                                               version)

        return ui_pb2.PingReply(id=request.id)
Ejemplo n.º 2
0
    def Ping(self, request, context):
        if self._is_local_request(context):
            self._last_ping = datetime.now()
            self._stats_dialog.update(request.stats)

            if request.stats.daemon_version != version:
                self._version_warning_trigger.emit(request.stats.daemon_version, version)
        else:
            with self._remote_lock:
                _, addr, _ = context.peer().split(':')
                if addr in self._remote_stats:
                    self._remote_stats[addr].update(request.stats)
                else:
                    self._new_remote_trigger.emit(addr, request.stats)

        return ui_pb2.PingReply(id=request.id)
Ejemplo n.º 3
0
    def Ping(self, request, context):
        try:
            self._last_ping = datetime.now()
            self._check_versions(request.stats.daemon_version)

            proto, addr = self._get_peer(context.peer())
            # do not update db here, do it on the main thread
            self._update_stats_trigger.emit(proto, addr, request)
            #else:
            #    with self._remote_lock:
            #        # XXX: disable this option for now
            #        # opening several dialogs only updates one of them.
            #        if addr not in self._remote_stats:
            #            self._new_remote_trigger.emit(addr, request)
            #        else:
            #            self._populate_stats(self._remote_stats[addr]['dialog'].get_db(), proto, addr, request.stats)
            #            self._remote_stats[addr]['dialog'].update(addr, request.stats)

        except Exception as e:
            print("Ping exception: ", e)

        return ui_pb2.PingReply(id=request.id)
Ejemplo n.º 4
0
    def Ping(self, request, context):
        self.stats_dialog.update(request.stats)
	return ui_pb2.PingReply(id=request.id)