mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-05-05 09:47:47 +08:00
Add scheduled tasks (#13470)
### What problem does this PR solve? 1. RAGFlow server will send heartbeat periodically. 2. This PR will including: - Scheduled task - API server message sending - Admin server API to receive the message. ### Type of change - [x] New Feature (non-breaking change which adds functionality) --------- Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
33
internal/common/status_message.go
Normal file
33
internal/common/status_message.go
Normal file
@ -0,0 +1,33 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type MessageType string
|
||||
|
||||
const (
|
||||
MessageHeartbeat MessageType = "heartbeat"
|
||||
MessageMetric MessageType = "metric"
|
||||
MessageEvent MessageType = "event"
|
||||
)
|
||||
|
||||
type ServerType string
|
||||
|
||||
const (
|
||||
ServerTypeAPI ServerType = "api_server" // API server
|
||||
ServerTypeWorker ServerType = "ingestor" // Ingestion server
|
||||
ServerTypeScheduler ServerType = "data_collector" // Data collection server
|
||||
)
|
||||
|
||||
type BaseMessage struct {
|
||||
MessageID int64 `json:"report_id"`
|
||||
MessageType MessageType `json:"report_type"`
|
||||
ServerName string `json:"server_id"`
|
||||
ServerType ServerType `json:"server_type"`
|
||||
Host string `json:"host"`
|
||||
Port int `json:"port"`
|
||||
Version string `json:"version"`
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
Ext map[string]interface{} `json:"ext,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user