Compare commits

..

2 Commits

Author SHA1 Message Date
af9818ae7f update
Some checks are pending
CI / Lint (push) Waiting to run
CI / Test (push) Waiting to run
CI / End-to-End (push) Waiting to run
CI / Publish Docker (push) Blocked by required conditions
continuous-integration/drone/push Build is passing
2024-09-13 15:01:36 +10:00
2a3042ea3f update events table when event processed 2024-09-13 15:01:35 +10:00
2 changed files with 9 additions and 2 deletions

View File

@@ -69,6 +69,13 @@ func (c *CronTask) RunVmCheck(ctx context.Context, logger *slog.Logger) error {
c.Logger.Debug("Simulate adding to Inventory", "vm_name", evt.VmName.String, "vcpus", numVcpus, "ram", numRam, "dc", datacenter)
// mark this event as processed
err = c.Database.Queries().UpdateEventsProcessed(ctx, evt.Eid)
if err != nil {
c.Logger.Error("Unable to mark this event as processed", "event_id", evt.Eid, "error", err)
} else {
c.Logger.Debug("Marked event as processed", "event_id", evt.Eid)
}
}
//fmt.Printf("processing at %s", time.Now())

View File

@@ -82,7 +82,7 @@ func (v *Vcenter) Login(vUrl string) error {
}
func (v *Vcenter) Logout() error {
v.Logger.Debug("vcenter logging out")
//v.Logger.Debug("vcenter logging out")
if v.ctx == nil {
v.Logger.Warn("Nil context, unable to logout")
@@ -90,7 +90,7 @@ func (v *Vcenter) Logout() error {
}
if v.client.Valid() {
v.Logger.Debug("vcenter client is valid. Logging out")
//v.Logger.Debug("vcenter client is valid. Logging out")
return v.client.Logout(v.ctx)
} else {
v.Logger.Debug("vcenter client is not valid")