mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
refactor: change all timestamps to be in seconds
This commit is contained in:
@@ -105,7 +105,7 @@ const createRepository = async (name: string, config: RepositoryConfig, compress
|
||||
if (!error) {
|
||||
await db
|
||||
.update(repositoriesTable)
|
||||
.set({ status: "healthy", lastChecked: Date.now(), lastError: null })
|
||||
.set({ status: "healthy", lastChecked: Math.floor(Date.now() / 1000), lastError: null })
|
||||
.where(eq(repositoriesTable.id, id));
|
||||
|
||||
return { repository: created, status: 201 };
|
||||
@@ -258,7 +258,7 @@ const checkHealth = async (repositoryId: string) => {
|
||||
.update(repositoriesTable)
|
||||
.set({
|
||||
status,
|
||||
lastChecked: Date.now(),
|
||||
lastChecked: Math.floor(Date.now() / 1000),
|
||||
lastError: error,
|
||||
})
|
||||
.where(eq(repositoriesTable.id, repository.id));
|
||||
@@ -335,7 +335,7 @@ const doctorRepository = async (name: string) => {
|
||||
.update(repositoriesTable)
|
||||
.set({
|
||||
status: allSuccessful ? "healthy" : "error",
|
||||
lastChecked: Date.now(),
|
||||
lastChecked: Math.floor(Date.now() / 1000),
|
||||
lastError: allSuccessful ? null : steps.find((s) => !s.success)?.error,
|
||||
})
|
||||
.where(eq(repositoriesTable.id, repository.id));
|
||||
|
||||
Reference in New Issue
Block a user