diff --git a/platform/arcgis.go b/platform/arcgis.go index 1d9b0ecf..4454b741 100644 --- a/platform/arcgis.go +++ b/platform/arcgis.go @@ -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