report geoip separately, fix server creation & deletion bugs (#14)

* new geoip method

* report geoip separately, fix server creation & deletion bugs

* fix struct tag

* fix write name

* remove deleteion list

* remove rpc realip header

* Revert "remove rpc realip header"

This reverts commit 8a5f86cf2d7df87f28cfa2a3b3430f449dd6ed73.
This commit is contained in:
UUBulb
2024-11-22 22:40:43 +08:00
committed by GitHub
parent d699d0ee87
commit fc98c0919f
16 changed files with 427 additions and 309 deletions

View File

@@ -27,6 +27,7 @@ type Server struct {
Host *Host `gorm:"-" json:"host,omitempty"`
State *HostState `gorm:"-" json:"state,omitempty"`
GeoIP *GeoIP `gorm:"-" json:"geoip,omitempty"`
LastActive time.Time `gorm:"-" json:"last_active,omitempty"`
TaskClose chan error `gorm:"-" json:"-"`
@@ -40,6 +41,7 @@ type Server struct {
func (s *Server) CopyFromRunningServer(old *Server) {
s.Host = old.Host
s.State = old.State
s.GeoIP = old.GeoIP
s.LastActive = old.LastActive
s.TaskClose = old.TaskClose
s.TaskCloseLock = old.TaskCloseLock