@@ -623,12 +623,13 @@ func (s *Store) insertEndpointResultWithSuiteID(tx *sql.Tx, endpointID int64, re
623623 var endpointResultID int64
624624 err := tx .QueryRow (
625625 `
626- INSERT INTO endpoint_results (endpoint_id, success, errors, connected, status, dns_rcode, certificate_expiration, domain_expiration, hostname, ip, duration, timestamp, suite_result_id)
627- VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)
626+ INSERT INTO endpoint_results (endpoint_id, success, state, errors, connected, status, dns_rcode, certificate_expiration, domain_expiration, hostname, ip, duration, timestamp, suite_result_id)
627+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14 )
628628 RETURNING endpoint_result_id
629629 ` ,
630630 endpointID ,
631631 result .Success ,
632+ result .State ,
632633 strings .Join (result .Errors , arraySeparator ),
633634 result .Connected ,
634635 result .HTTPStatus ,
@@ -791,7 +792,7 @@ func (s *Store) getEndpointEventsByEndpointID(tx *sql.Tx, endpointID int64, page
791792func (s * Store ) getEndpointResultsByEndpointID (tx * sql.Tx , endpointID int64 , page , pageSize int ) (results []* endpoint.Result , err error ) {
792793 rows , err := tx .Query (
793794 `
794- SELECT endpoint_result_id, success, errors, connected, status, dns_rcode, certificate_expiration, domain_expiration, hostname, ip, duration, timestamp
795+ SELECT endpoint_result_id, success, state, errors, connected, status, dns_rcode, certificate_expiration, domain_expiration, hostname, ip, duration, timestamp
795796 FROM endpoint_results
796797 WHERE endpoint_id = $1
797798 ORDER BY endpoint_result_id DESC -- Normally, we'd sort by timestamp, but sorting by endpoint_result_id is faster
@@ -809,7 +810,7 @@ func (s *Store) getEndpointResultsByEndpointID(tx *sql.Tx, endpointID int64, pag
809810 result := & endpoint.Result {}
810811 var id int64
811812 var joinedErrors string
812- err = rows .Scan (& id , & result .Success , & joinedErrors , & result .Connected , & result .HTTPStatus , & result .DNSRCode , & result .CertificateExpiration , & result .DomainExpiration , & result .Hostname , & result .IP , & result .Duration , & result .Timestamp )
813+ err = rows .Scan (& id , & result .Success , & result . State , & joinedErrors , & result .Connected , & result .HTTPStatus , & result .DNSRCode , & result .CertificateExpiration , & result .DomainExpiration , & result .Hostname , & result .IP , & result .Duration , & result .Timestamp )
813814 if err != nil {
814815 logr .Errorf ("[sql.getEndpointResultsByEndpointID] Silently failed to retrieve endpoint result for endpointID=%d: %s" , endpointID , err .Error ())
815816 err = nil
0 commit comments