1
0
Fork 0
mirror of https://github.com/Luzifer/sii.git synced 2024-12-30 04:11:15 +00:00

Increase expiry time to suite long routes

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2020-01-04 18:11:02 +01:00
parent c294ea1308
commit c43d142d3e
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -7,10 +7,13 @@ import (
"strings"
"time"
"github.com/Luzifer/sii"
"github.com/pkg/errors"
"github.com/Luzifer/sii"
)
const jobExpiryPerSegment = 4 * 24 * 60 // 4d * 24h * 60m
const (
fixAll = "all"
fixCargoOnly = "cargo"
@ -194,7 +197,7 @@ func addJobToGame(game *sii.Unit, job commSaveJob, routePartID int) error {
strconv.FormatInt(time.Now().Unix(), 16),
strconv.FormatInt(int64(routePartID), 16),
}, ".")
exTime := game.BlocksByClass("economy")[0].(*sii.Economy).GameTime + 300 // 300min = 5h
exTime := game.BlocksByClass("economy")[0].(*sii.Economy).GameTime + jobExpiryPerSegment*int64(routePartID+1)
j := &sii.JobOfferData{
// User requested job data
Target: strings.TrimPrefix(job.TargetReference, "company.volatile."),