Revert "Fix/devops/docker compose"

This commit is contained in:
Alexander Holliday authored and GitHub committed 2024-10-30 10:13:03 +08:00
1 parent 5e9804d01f
commit 100cea64af
4 files changed
+109 -72

No files matched your search

+30 -4
View File
@@ -1,5 +1,5 @@
import mongoose from "mongoose";
import { BaseCheckSchema } from "./Check.js";
const cpuSchema = mongoose.Schema({
physical_core: { type: Number, default: 0 },
logical_core: { type: Number, default: 0 },
@@ -32,7 +32,35 @@ const hostSchema = mongoose.Schema({
const HardwareCheckSchema = mongoose.Schema(
{
...BaseCheckSchema.obj,
monitorId: {
type: mongoose.Schema.Types.ObjectId,
ref: "Monitor",
immutable: true,
index: true,
},
status: {
type: Boolean,
index: true,
},
responseTime: {
type: Number,
},
statusCode: {
type: Number,
index: true,
},
message: {
type: String,
},
expiry: {
type: Date,
default: Date.now,
expires: 60 * 60 * 24 * 30, // 30 days
},
cpu: {
type: cpuSchema,
default: () => ({}),
@@ -53,6 +81,4 @@ const HardwareCheckSchema = mongoose.Schema(
{ timestamps: true }
);
HardwareCheckSchema.index({ createdAt: 1 });
export default mongoose.model("HardwareCheck", HardwareCheckSchema);