Skip to content

Commit

Permalink
Fixed timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
AsafMah committed Jan 16, 2025
1 parent bc59cd0 commit ff97a7f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions azkustoingest/internal/status/status_table_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
"github.com/Azure/azure-sdk-for-go/sdk/data/aztables"
"github.com/google/uuid"
"time"
)

const (
defaultTimeoutMsec = 10000
fullMetadata = aztables.MetadataFormatFull
defaultTimeoutSeconds = 10
fullMetadata = aztables.MetadataFormatFull
)

// TableClient allows reading and writing to azure tables.
Expand Down Expand Up @@ -58,7 +59,7 @@ func (c *TableClient) Read(ctx context.Context, ingestionSourceID string) (map[s

// Write reads a table record containing ingestion status.
func (c *TableClient) Write(ctx context.Context, ingestionSourceID string, data map[string]interface{}) error {
ctx, cancel := context.WithTimeout(ctx, defaultTimeoutMsec)
ctx, cancel := context.WithTimeout(ctx, defaultTimeoutSeconds*time.Second)
defer cancel()

data["PartitionKey"] = ingestionSourceID
Expand Down

0 comments on commit ff97a7f

Please sign in to comment.