Use new jet query for getting users from org ID
Some checks failed
/ golint (push) Has been cancelled
Some checks failed
/ golint (push) Has been cancelled
This is to try to avoid an area where we know our query pool is getting blocked. Related to issue #3.
This commit is contained in:
parent
85957b5ae6
commit
77ea99647e
1 changed files with 2 additions and 3 deletions
|
|
@ -25,6 +25,7 @@ import (
|
|||
"github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/arcgis/model"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/models"
|
||||
queryarcgis "github.com/Gleipnir-Technology/nidus-sync/db/query/arcgis"
|
||||
querypublic "github.com/Gleipnir-Technology/nidus-sync/db/query/public"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/sql"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/debug"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/h3utils"
|
||||
|
|
@ -55,7 +56,7 @@ func IsSyncOngoing(org_id int32) bool {
|
|||
return syncStatusByOrg[org_id]
|
||||
}
|
||||
func getOAuthForOrg(ctx context.Context, org *models.Organization) (*model.OAuthToken, error) {
|
||||
users, err := org.User().All(ctx, db.PGInstance.BobDB)
|
||||
users, err := querypublic.UsersFromOrganizationID(ctx, db.PGInstance.PGXPool, int64(org.ID))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Failed to query all users for org: %w", err)
|
||||
}
|
||||
|
|
@ -649,7 +650,6 @@ func markTokenFailed(ctx context.Context, oauth *model.OAuthToken) {
|
|||
log.Info().Int("id", int(oauth.ID)).Msg("Marked oauth token invalid")
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
func saveRawQuery(fssync fieldseeker.FieldSeeker, layer arcgis.LayerFeature, query *arcgis.Query, filename string) {
|
||||
output, err := os.Create(filename)
|
||||
|
|
@ -673,7 +673,6 @@ func saveRawQuery(fssync fieldseeker.FieldSeeker, layer arcgis.LayerFeature, que
|
|||
}
|
||||
*/
|
||||
|
||||
|
||||
func exportFieldseekerLayer(ctx context.Context, group pond.ResultTaskGroup[SyncStats], org *models.Organization, fssync *fieldseeker.FieldSeeker, layer response.Layer) (SyncStats, error) {
|
||||
var stats SyncStats
|
||||
return stats, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue