stringer and cleanup
This commit is contained in:
parent
35f0a86c2c
commit
dc2d32b002
|
@ -72,6 +72,8 @@ func main() {
|
|||
if err != nil {
|
||||
log.Printf("tasks:http: error publishing results: %v", err)
|
||||
}
|
||||
|
||||
log.Printf()
|
||||
})
|
||||
|
||||
for {
|
||||
|
|
|
@ -2,20 +2,23 @@ version: "3"
|
|||
|
||||
services:
|
||||
rqlite:
|
||||
restart: always
|
||||
image: rqlite/rqlite:4.0.2
|
||||
volumes:
|
||||
- rqlite:/rqlite/file
|
||||
command: -on-disk -http-adv-addr rqlite:4001
|
||||
|
||||
nats:
|
||||
restart: always
|
||||
image: nats:1.0.2
|
||||
entrypoint: "/gnatsd -DV" # uncomment for debugging message queue issues
|
||||
#entrypoint: "/gnatsd -DV" # uncomment for debugging message queue issues
|
||||
expose:
|
||||
- "4222"
|
||||
ports:
|
||||
- "8222:8222"
|
||||
|
||||
worker:
|
||||
restart: always
|
||||
image: xena/mercy:$GIT_COMMIT
|
||||
environment:
|
||||
NATS_URL: nats://nats:4222
|
||||
|
@ -24,6 +27,7 @@ services:
|
|||
- nats
|
||||
|
||||
kronos:
|
||||
restart: always
|
||||
image: xena/mercy:$GIT_COMMIT
|
||||
depends_on:
|
||||
- nats
|
||||
|
@ -34,6 +38,7 @@ services:
|
|||
command: /go/bin/kronos
|
||||
|
||||
mercyd:
|
||||
restart: always
|
||||
image: xena/mercy:$GIT_COMMIT
|
||||
environment:
|
||||
NATS_URL: nats://nats:4222
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/nats-io/go-nats"
|
||||
nats "github.com/nats-io/go-nats"
|
||||
)
|
||||
|
||||
func NatsConnect(u string) (*nats.Conn, error) {
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
// Code generated by "stringer -type=Result"; DO NOT EDIT.
|
||||
|
||||
package common
|
||||
|
||||
import "fmt"
|
||||
|
||||
const _Result_name = "UnknownOKDegradedFailed"
|
||||
|
||||
var _Result_index = [...]uint8{0, 7, 9, 17, 23}
|
||||
|
||||
func (i Result) String() string {
|
||||
if i < 0 || i >= Result(len(_Result_index)-1) {
|
||||
return fmt.Sprintf("Result(%d)", i)
|
||||
}
|
||||
return _Result_name[_Result_index[i]:_Result_index[i+1]]
|
||||
}
|
|
@ -4,6 +4,8 @@ import "time"
|
|||
|
||||
type Result int
|
||||
|
||||
//go:generate stringer -type=Result
|
||||
|
||||
const (
|
||||
Unknown Result = iota
|
||||
OK
|
||||
|
|
|
@ -2,7 +2,6 @@ package database
|
|||
|
||||
import (
|
||||
"database/sql"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"git.xeserv.us/xena/mercy/internal/common"
|
||||
|
@ -123,7 +122,6 @@ func (c *Checks) InsertCheck(ch *common.Check) error {
|
|||
func (c *Checks) GetAllChecks() ([]common.Check, error) {
|
||||
var result []common.Check
|
||||
q := c.getAllChecks.Bind()
|
||||
log.Println(q)
|
||||
res, err := c.conn.QueryOne(q)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in New Issue