Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/threads #92

Merged
merged 5 commits into from
Sep 12, 2023
Merged

Feat/threads #92

merged 5 commits into from
Sep 12, 2023

Conversation

dvilelaf
Copy link
Collaborator

Proposed changes

  • Implements the possibility for the service to publish threads
  • Fixes an issue with round transitions
  • Fixes a configuration issue

Fixes

n/a

Types of changes

What types of changes does your code introduce? (A breaking change is a fix or feature that would cause existing functionality and APIs to not work as expected.)
Put an x in the box that applies

  • Non-breaking fix (non-breaking change which fixes an issue)
  • Breaking fix (breaking change which fixes an issue)
  • Non-breaking feature (non-breaking change which adds functionality)
  • Breaking feature (breaking change which adds functionality)
  • Refactor (non-breaking change which changes implementation)
  • Messy (mixture of the above - requires explanation!)

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I am making a pull request against the main branch (left side). Also you should start your branch off our main.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have locally run services that could be impacted and they do not present failures derived from my changes

Further comments

n/a

Comment on lines +183 to +195
if isinstance(text, list):
# Thread
previous_tweet_id = None
for tweet in text:
if not previous_tweet_id:
response = api.create_tweet(text=tweet)
else:
response = api.create_tweet(text=tweet, in_reply_to_tweet_id=previous_tweet_id)
previous_tweet_id = response.data["id"]
else:
# Single tweet
response = api.create_tweet(text=text)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thread implementation: if the data passed is a list, we post it as a thread.

@@ -80,7 +80,7 @@ extra:
termination_sleep: ${TERMINATION_SLEEP:int:900}
reset_pause_duration: ${RESET_PAUSE_DURATION:int:300}
on_chain_service_id: ${ON_CHAIN_SERVICE_ID:int:null}
reset_tendermint_after: ${RESET_TENDERMINT_AFTER:int:300}
reset_tendermint_after: ${RESET_TENDERMINT_AFTER:int:30}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small config fix

Comment on lines +610 to +618
Event.NO_MAJORITY: TwitterRandomnessRound,
Event.ROUND_TIMEOUT: TwitterRandomnessRound,
},
TwitterHashtagsCollectionRound: {
Event.DONE: TwitterDecisionMakingRound,
Event.DONE_MAX_RETRIES: TwitterDecisionMakingRound,
Event.API_ERROR: TwitterHashtagsCollectionRound,
Event.NO_MAJORITY: TwitterHashtagsCollectionRound,
Event.ROUND_TIMEOUT: TwitterHashtagsCollectionRound,
Event.NO_MAJORITY: TwitterRandomnessRound,
Event.ROUND_TIMEOUT: TwitterRandomnessRound,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should select new keepers whenever we time out. I found an issue today where the service was stuck in a timeout loop.

@dvilelaf dvilelaf merged commit 2c72565 into main Sep 12, 2023
19 checks passed
@dvilelaf dvilelaf deleted the feat/threads branch September 12, 2023 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants