first_checked_at and last_checked_at columns filled with different datetimes. #3

Closed
opened 2022-03-03 11:26:36 +01:00 by spla · 1 comment
spla commented 2022-03-03 11:26:36 +01:00 (Migrated from 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 commented 2022-03-03 11:26:36 +01:00 (Migrated from gitlab.com)

assigned to @spla

assigned to @spla
Sign in to join this conversation.
No Label
bug
suggestion
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: spla/fediverse#3
No description provided.