impl job uid in case somebody reuses ids
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package broker
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"local/truckstop/config"
|
||||
"local/truckstop/logtr"
|
||||
@@ -26,6 +27,18 @@ type JobLocation struct {
|
||||
State string
|
||||
}
|
||||
|
||||
func (j Job) UID() string {
|
||||
return fmt.Sprintf(
|
||||
"%v-%s-%s-%s-%s-%v",
|
||||
j.ID,
|
||||
j.Pickup.State,
|
||||
base64.StdEncoding.EncodeToString([]byte(j.Pickup.City)),
|
||||
j.Dropoff.State,
|
||||
base64.StdEncoding.EncodeToString([]byte(j.Dropoff.City)),
|
||||
j.Pickup.Date.Unix(),
|
||||
)
|
||||
}
|
||||
|
||||
func (j *Job) Secrets() {
|
||||
if j.secrets == nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user