summaryrefslogtreecommitdiff
path: root/event.go
blob: c6e4bb5476d06ffffbbbdb4b197890732d193ed3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package main

import (
	"time"

	"go.wit.com/lib/gui/shell"
	"go.wit.com/log"
)

func (d *DropletT) Start() {
	log.Info("a new virtual machine is running")
}

func (h *HyperT) RestartDaemon() {
	url := "http://" + h.Hostname + ":2520/kill"
	s := shell.Wget(url)
	log.Info("EVENT RestartDaemon", url, s)
	h.lastpoll = time.Now()
	h.killcount += 1

	dur := time.Since(h.lastpoll) // Calculate the elapsed time
	log.Info("KILLED DAEMON", h.Hostname, shell.FormatDuration(dur), "curl", url)
	me.killcount += 1
}