first_checked_at and last_checked_at columns filled with different datetimes. #3

Tancada
oberta 2022-03-03 11:26:36 +01:00 per spla · 1 comment
spla ha comentat 2022-03-03 11:26:36 +01:00 (Migrado desde gitlab.com)

Every process of the multiprocessing get the datetime at run time so all checked servers have different datetimes in their columns first_checked_at and last_checked_at. This is a problem because they will have different uptimes.

Solution is initialize 'now' parameter into the Server Class and after the creation of the Server Class's instance assign current datetime to it.

`class Server:

name = 'Server'

def __init_(self, server, software, users, alive, api, soft_version, now):

    self.server = server
    self.software = software
    self.users = users
    self.alive = alive
    self.api = api
    self.version = self.soft_version
    self.now = now`
Every process of the multiprocessing get the datetime at run time so all checked servers have different datetimes in their columns first_checked_at and last_checked_at. This is a problem because they will have different uptimes. Solution is initialize 'now' parameter into the Server Class and after the creation of the Server Class's instance assign current datetime to it. `class Server: name = 'Server' def __init_(self, server, software, users, alive, api, soft_version, now): self.server = server self.software = software self.users = users self.alive = alive self.api = api self.version = self.soft_version self.now = now`
spla ha comentat 2022-03-03 11:26:36 +01:00 (Migrado desde gitlab.com)

assigned to @spla

assigned to @spla
Inicia sessió per a unir-te a aquesta conversa.
Sin etiquetas
bug
suggestion
Sense Milestone
Ningún proyecto
Sense assignats
1 participant
Notificacions
Data de venciment
La fecha de vencimiento es inválida o está fuera de rango. Por favor utilice el formato 'aaaa-mm-dd'.

Sin fecha de vencimiento.

Dependències

Aquesta incidència no té cap dependència.

Referència: spla/fediverse#3
Aún no existe contenido.