add config name for identifying who wants what

master
Bel LaPointe 2022-01-11 08:16:02 -05:00
parent 29ae26153f
commit e12299ac20
4 changed files with 8 additions and 2 deletions

View File

@ -2,6 +2,7 @@ package broker
import ( import (
"fmt" "fmt"
"local/truckstop/config"
"time" "time"
) )
@ -37,7 +38,8 @@ func (j JobLocation) String() string {
func (j Job) FormatMultilineText() string { func (j Job) FormatMultilineText() string {
return fmt.Sprintf( return fmt.Sprintf(
"--- %s => %s ---\nPickup: %s\nDropoff: %s\nNotes: %d lbs, %d miles, %s", "--- %s: %s => %s ---\nPickup: %s\nDropoff: %s\nNotes: %d lbs, %d miles, %s",
config.Get().Name,
j.Pickup.State, j.Pickup.State,
j.Dropoff.State, j.Dropoff.State,
j.Pickup.String(), j.Pickup.String(),

View File

@ -1,4 +1,5 @@
{ {
"Name": "pa",
"Interval": { "Interval": {
"OK": "6h0m0s", "OK": "6h0m0s",
"Error": "6h", "Error": "6h",

View File

@ -10,6 +10,7 @@ import (
) )
type Config struct { type Config struct {
Name string
Interval struct { Interval struct {
Email Duration Email Duration
OK Duration OK Duration

View File

@ -3,9 +3,11 @@ todo:
subtasks: subtasks:
- banlist criteria like vendors, brokers, metadata - banlist criteria like vendors, brokers, metadata
- quiet hours - quiet hours
- setup pa on element - setup ma on element
- accept states via element for one system - accept states via element for one system
- set up copy for caleb, broc
done: done:
- setup pa on element
- configurable email interval - configurable email interval
- jitter on intervals, including dedicated err span - jitter on intervals, including dedicated err span
- email doesnt get all matches - email doesnt get all matches