Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-nicolas committed Jan 25, 2024
1 parent f64e67c commit 116e88d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type fetchTransactionsState struct {
FirstCreatedTransactionCreationDate time.Time `json:"first_created_transaction_creation_date"`
}

func taskFetchTransactions(client *client.Client, userID string) task.Task {
func taskFetchTransactions(client *client.Client, walletsID string) task.Task {
return func(
ctx context.Context,
taskID models.TaskID,
Expand All @@ -45,13 +45,13 @@ func taskFetchTransactions(client *client.Client, userID string) task.Task {
"mangopay.taskFetchTransactions",
attribute.String("connectorID", connectorID.String()),
attribute.String("taskID", taskID.String()),
attribute.String("userID", userID),
attribute.String("walletsID", walletsID),
)
defer span.End()

state := task.MustResolveTo(ctx, resolver, fetchTransactionsState{})

newState, err := fetchTransactions(ctx, client, userID, connectorID, ingester, state)
newState, err := fetchTransactions(ctx, client, walletsID, connectorID, ingester, state)
if err != nil {
otel.RecordError(span, err)
return err
Expand All @@ -69,7 +69,7 @@ func taskFetchTransactions(client *client.Client, userID string) task.Task {
func fetchTransactions(
ctx context.Context,
client *client.Client,
userID string,
walletsID string,
connectorID models.ConnectorID,
ingester ingestion.Ingester,
state fetchTransactionsState,
Expand All @@ -79,7 +79,7 @@ func fetchTransactions(
var firstCreatedCreationDate time.Time
var lastCreationDate time.Time
for page := 1; ; page++ {
pagedPayments, err := client.GetTransactions(ctx, userID, page, pageSize, state.FirstCreatedTransactionCreationDate)
pagedPayments, err := client.GetTransactions(ctx, walletsID, page, pageSize, state.FirstCreatedTransactionCreationDate)
if err != nil {
return fetchTransactionsState{}, err
}
Expand Down

0 comments on commit 116e88d

Please sign in to comment.