Skip to content

Commit

Permalink
fix: wait on rate limit
Browse files Browse the repository at this point in the history
  • Loading branch information
dvilelaf committed Jun 14, 2024
1 parent e2322a1 commit dd325f3
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
6 changes: 3 additions & 3 deletions packages/dvilela/agents/tsunami/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ connections:
- valory/ledger:0.19.0:bafybeig7woeog4srdby75hpjkmx4rhpkzncbf4h2pm5r6varsp26pf2uhu
- valory/p2p_libp2p_client:0.1.0:bafybeid3xg5k2ol5adflqloy75ibgljmol6xsvzvezebsg7oudxeeolz7e
- valory/farcaster:0.1.0:bafybeibbdas7lxbipksodaphjms3uop7vnzjqkroktjq2g6wbvgtlldaxi
- valory/twitter:0.1.0:bafybeihotqawulig3g4a7fosi4pljsjii2neiqxtepd42e2neemhqecfcq
- valory/twitter:0.1.0:bafybeid47wlygghs5c6dqqh3itr44ohfjylnbvalknn47hec5lbhlym7oy
- dvilela/kv_store:0.1.0:bafybeiekugvb2kan4342hliluxl3h5och3fjwqoafdyttpcn57evvyztq4
- dvilela/llama:0.1.0:bafybeiauzzq2pxmn4brdqgdyxrrikbc5ywjpmetlajyohute5qtnn37aqq
- dvilela/suno:0.1.0:bafybeihy2phtjwbz27ntv55wxfk754kp5tjceujzsdbppjafljoydjflhi
Expand Down Expand Up @@ -47,8 +47,8 @@ skills:
- valory/transaction_settlement_abci:0.1.0:bafybeic3tccdjypuge2lewtlgprwkbb53lhgsgn7oiwzyrcrrptrbeyote
- valory/registration_abci:0.1.0:bafybeieu7vq3pyns4t5ty6u3sbmpkd7yznpg3rmqifoz3jhy7pmqyg3w6q
- valory/reset_pause_abci:0.1.0:bafybeiameewywqigpupy3u2iwnkfczeiiucue74x2l5lbge74rmw6bgaie
- dvilela/tsunami_abci:0.1.0:bafybeihprbhxzv23xqau5ffo5y5c4pjfbe2pcbssjgbtgi3hesyvfp4eva
- dvilela/tsunami_chained_abci:0.1.0:bafybeiexybjocvolk3l3lfoozkonltgccn3jddo5o52cemdzadxnka66wu
- dvilela/tsunami_abci:0.1.0:bafybeibllenzjmlikjrbrrarvdfv4wyf4dni73x5oiny4nl5crl3maflfa
- dvilela/tsunami_chained_abci:0.1.0:bafybeicipb6wwfarfjglpqbezobxpbzw64vhyuji374vc7iexiahwj36bm
default_ledger: ethereum
required_ledgers:
- ethereum
Expand Down
2 changes: 1 addition & 1 deletion packages/dvilela/services/tsunami/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license: Apache-2.0
fingerprint:
README.md: bafybeibh5bgshii5oqjfuhwmiivfvfqy7fw5pzvarxkpe4qrgivxtc3xym
fingerprint_ignore_patterns: []
agent: dvilela/tsunami:0.1.0:bafybeicncvmrk363bn3og5zkbr2qxcg6nuxk2znkj65oj2dsb5skk66cfe
agent: dvilela/tsunami:0.1.0:bafybeih67rinhrhazcovrcjyboqxhogwxzt5gjipxtjhklzf25a5atk7my
number_of_agents: 1
deployment:
agent:
Expand Down
2 changes: 1 addition & 1 deletion packages/dvilela/skills/tsunami_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ connections:
- dvilela/llama:0.1.0:bafybeiauzzq2pxmn4brdqgdyxrrikbc5ywjpmetlajyohute5qtnn37aqq
- dvilela/suno:0.1.0:bafybeihy2phtjwbz27ntv55wxfk754kp5tjceujzsdbppjafljoydjflhi
- valory/farcaster:0.1.0:bafybeibbdas7lxbipksodaphjms3uop7vnzjqkroktjq2g6wbvgtlldaxi
- valory/twitter:0.1.0:bafybeihotqawulig3g4a7fosi4pljsjii2neiqxtepd42e2neemhqecfcq
- valory/twitter:0.1.0:bafybeid47wlygghs5c6dqqh3itr44ohfjylnbvalknn47hec5lbhlym7oy
- valory/http_server:0.22.0:bafybeihpgu56ovmq4npazdbh6y6ru5i7zuv6wvdglpxavsckyih56smu7m
contracts:
- dvilela/olas_registries:0.1.0:bafybeict2xpt56m2a5ehezd2oylrhbhahrsas3dht2fdfbnrejlr5mdqpa
Expand Down
2 changes: 1 addition & 1 deletion packages/dvilela/skills/tsunami_chained_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ skills:
- valory/reset_pause_abci:0.1.0:bafybeiameewywqigpupy3u2iwnkfczeiiucue74x2l5lbge74rmw6bgaie
- valory/transaction_settlement_abci:0.1.0:bafybeic3tccdjypuge2lewtlgprwkbb53lhgsgn7oiwzyrcrrptrbeyote
- valory/termination_abci:0.1.0:bafybeif2zim2de356eo3sipkmoev5emwadpqqzk3huwqarywh4tmqt3vzq
- dvilela/tsunami_abci:0.1.0:bafybeihprbhxzv23xqau5ffo5y5c4pjfbe2pcbssjgbtgi3hesyvfp4eva
- dvilela/tsunami_abci:0.1.0:bafybeibllenzjmlikjrbrrarvdfv4wyf4dni73x5oiny4nl5crl3maflfa
behaviours:
main:
args: {}
Expand Down
10 changes: 5 additions & 5 deletions packages/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"contract/dvilela/olas_treasury/0.1.0": "bafybeidd6yelhuztyvtbso6fkc4iiq2pmegh734exyrtcbqh62yfwgluqy",
"connection/dvilela/kv_store/0.1.0": "bafybeiekugvb2kan4342hliluxl3h5och3fjwqoafdyttpcn57evvyztq4",
"connection/dvilela/llama/0.1.0": "bafybeiauzzq2pxmn4brdqgdyxrrikbc5ywjpmetlajyohute5qtnn37aqq",
"connection/valory/twitter/0.1.0": "bafybeihotqawulig3g4a7fosi4pljsjii2neiqxtepd42e2neemhqecfcq",
"connection/valory/twitter/0.1.0": "bafybeid47wlygghs5c6dqqh3itr44ohfjylnbvalknn47hec5lbhlym7oy",
"connection/dvilela/suno/0.1.0": "bafybeihy2phtjwbz27ntv55wxfk754kp5tjceujzsdbppjafljoydjflhi",
"skill/dvilela/tsunami_abci/0.1.0": "bafybeihprbhxzv23xqau5ffo5y5c4pjfbe2pcbssjgbtgi3hesyvfp4eva",
"skill/dvilela/tsunami_chained_abci/0.1.0": "bafybeiexybjocvolk3l3lfoozkonltgccn3jddo5o52cemdzadxnka66wu",
"agent/dvilela/tsunami/0.1.0": "bafybeicncvmrk363bn3og5zkbr2qxcg6nuxk2znkj65oj2dsb5skk66cfe",
"service/dvilela/tsunami/0.1.0": "bafybeicowydwnnaoot72ptatbwfym77vrgnvfnnablm7e5m4xkh5t424le"
"skill/dvilela/tsunami_abci/0.1.0": "bafybeibllenzjmlikjrbrrarvdfv4wyf4dni73x5oiny4nl5crl3maflfa",
"skill/dvilela/tsunami_chained_abci/0.1.0": "bafybeicipb6wwfarfjglpqbezobxpbzw64vhyuji374vc7iexiahwj36bm",
"agent/dvilela/tsunami/0.1.0": "bafybeih67rinhrhazcovrcjyboqxhogwxzt5gjipxtjhklzf25a5atk7my",
"service/dvilela/tsunami/0.1.0": "bafybeig6u22ykofx4vwrzupxefqxybzw4ie3rxohm2fofnhslrieizmsze"
},
"third_party": {
"protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi",
Expand Down
4 changes: 4 additions & 0 deletions packages/valory/connections/twitter/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def create_tweet(
consumer_secret=credentials["consumer_secret"],
access_token=credentials["access_token"],
access_token_secret=credentials["access_secret"],
wait_on_rate_limit=True
)
)
try:
Expand All @@ -249,9 +250,11 @@ def create_tweet(
for tweet in text:
if not previous_tweet_id:
response = api.create_tweet(text=tweet)
self.logger.info(f"Tweepy response: {response}")
first_tweet_id = response.data["id"]
else:
response = api.create_tweet(text=tweet, in_reply_to_tweet_id=previous_tweet_id)
self.logger.info(f"Tweepy response: {response}")
previous_tweet_id = response.data["id"]
time.sleep(1)

Expand Down Expand Up @@ -292,6 +295,7 @@ def on_connect(self) -> None:
consumer_secret=self.consumer_secret,
access_token=self.access_token,
access_token_secret=self.access_secret,
wait_on_rate_limit=True
)

def on_disconnect(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/connections/twitter/connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license: Apache-2.0
aea_version: '>=1.0.0, <2.0.0'
fingerprint:
__init__.py: bafybeibxwzkyh7odchnlkeczpguencdjiizm4nezfmi4drybn2zd25xdkq
connection.py: bafybeiac3vcgb6j4hxp662pmr5hbz3f37zen5t7ehq44efqvxowiwu43ra
connection.py: bafybeicw3s7ul4rgccc66p4s3qqieofgqwazlf7tgbbdjoe5smfoh26yy4
readme.md: bafybeihg5yfzgqvg5ngy7r2o5tfeqnelx2ffxw4po5hmheqjfhumpmxpoq
fingerprint_ignore_patterns: []
connections: []
Expand Down

0 comments on commit dd325f3

Please sign in to comment.