AN-4428/add user agent to topshot and upd metadata job (#258)

* add user agent to topshot and upd metadata job

* upd agent

* upd limit to 600
This commit is contained in:
Jack Forgash 2024-01-18 09:19:18 -07:00 committed by GitHub
parent 59b3a5b4b5
commit e0818966ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 9 additions and 2 deletions

View File

@ -31,6 +31,7 @@ jobs:
dbt run -m silver__allday_moments_metadata_needed_s.sql;
dbt run-operation get_allday_metadata;
dbt run -m silver__nft_allday_metadata_s;
dbt run -s tag:topshot;
environment: workflow_prod
warehouse: ${{ vars.WAREHOUSE }}
secrets: inherit

View File

@ -51,7 +51,11 @@ def model(dbt, session):
# define params for UDF_API
method = 'POST'
headers = {
'Content-Type': 'application/json'
'Accept': 'application/json',
'Accept-Encoding': 'gzip',
'Connection': 'keep-alive',
'Content-Type': 'application/json',
'User-Agent': 'Flipside_Flow_metadata/0.1'
}
url = topshot_gql_params[0][0]
@ -63,7 +67,9 @@ def model(dbt, session):
inputs = dbt.ref(
'livequery__topshot_moments_metadata_needed').select(
"EVENT_CONTRACT", "MOMENT_ID"
).limit(3500)
).limit(600)
# Note prior limit of 3500 leads to 429 error / rate limit by system
# Per Dapper team, 50 reqs per 10 seconds. If exceeded, blocked for 30s.
# register the udf_construct_data function
udf_construct_data = register_udf_construct_data()