-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The matter of the fact is that some events are stuck in the queue and we just can't post tweets for them. As discussed earlier this may be because someone revoked permissions for our app or somehow ran out of their personal API limit - the exact reason is unclear and doesn't really matter. This commit removes events which are stuck in the queue after some time. The reasoning for this is twofold. Firstly the likelihood of actually successfuly posting a tweet which is stuck is very low. As far as I can tell they are just stuck. Secondly posting tweets for notes which are old can be confusing and I'd personally be surprised if I suddently had tweets for notes that are weeks old posted in my profile. This rollout has to happen in two stages. First we start emitting tweet created events containing new data (nostr events). After a week passes we drop all tweet created events that don't have nostr events in them and change the code to no longer support tweet created events with missing nostr events.
- Loading branch information
Showing
24 changed files
with
800 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package adapters | ||
|
||
import "time" | ||
|
||
type CurrentTimeProvider struct { | ||
} | ||
|
||
func NewCurrentTimeProvider() *CurrentTimeProvider { | ||
return &CurrentTimeProvider{} | ||
} | ||
|
||
func (c CurrentTimeProvider) GetCurrentTime() time.Time { | ||
return time.Now() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package mocks | ||
|
||
import ( | ||
"github.com/boreq/errors" | ||
"github.com/planetary-social/nos-crossposting-service/service/domain/accounts" | ||
) | ||
|
||
type AccountRepository struct { | ||
} | ||
|
||
func NewAccountRepository() (*AccountRepository, error) { | ||
return &AccountRepository{}, nil | ||
} | ||
|
||
func (m *AccountRepository) GetByTwitterID(twitterID accounts.TwitterID) (*accounts.Account, error) { | ||
return nil, errors.New("not implemented") | ||
} | ||
|
||
func (m *AccountRepository) GetByAccountID(accountID accounts.AccountID) (*accounts.Account, error) { | ||
return nil, errors.New("not implemented") | ||
} | ||
|
||
func (m *AccountRepository) Save(account *accounts.Account) error { | ||
return errors.New("not implemented") | ||
} | ||
|
||
func (m *AccountRepository) Count() (int, error) { | ||
return 0, errors.New("not implemented") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package mocks | ||
|
||
import "time" | ||
|
||
type CurrentTimeProvider struct { | ||
CurrentTime time.Time | ||
} | ||
|
||
func NewCurrentTimeProvider() *CurrentTimeProvider { | ||
return &CurrentTimeProvider{} | ||
} | ||
|
||
func (c *CurrentTimeProvider) GetCurrentTime() time.Time { | ||
return c.CurrentTime | ||
} | ||
|
||
func (c *CurrentTimeProvider) SetCurrentTime(currentTime time.Time) { | ||
c.CurrentTime = currentTime | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package mocks | ||
|
||
import ( | ||
"github.com/boreq/errors" | ||
"github.com/planetary-social/nos-crossposting-service/service/domain" | ||
"github.com/planetary-social/nos-crossposting-service/service/domain/accounts" | ||
) | ||
|
||
type ProcessedEventRepository struct { | ||
} | ||
|
||
func NewProcessedEventRepository() (*ProcessedEventRepository, error) { | ||
return &ProcessedEventRepository{}, nil | ||
} | ||
|
||
func (m *ProcessedEventRepository) Save(eventID domain.EventId, twitterID accounts.TwitterID) error { | ||
return errors.New("not implemented") | ||
} | ||
|
||
func (m *ProcessedEventRepository) WasProcessed(eventID domain.EventId, twitterID accounts.TwitterID) (bool, error) { | ||
return false, errors.New("not implemented") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package mocks | ||
|
||
import ( | ||
"github.com/boreq/errors" | ||
"github.com/planetary-social/nos-crossposting-service/service/domain" | ||
"github.com/planetary-social/nos-crossposting-service/service/domain/accounts" | ||
) | ||
|
||
type PublicKeyRepository struct { | ||
} | ||
|
||
func NewPublicKeyRepository() (*PublicKeyRepository, error) { | ||
return &PublicKeyRepository{}, nil | ||
} | ||
|
||
func (m *PublicKeyRepository) Save(linkedPublicKey *domain.LinkedPublicKey) error { | ||
return errors.New("not implemented") | ||
} | ||
|
||
func (m *PublicKeyRepository) Delete(accountID accounts.AccountID, publicKey domain.PublicKey) error { | ||
return errors.New("not implemented") | ||
} | ||
|
||
func (m *PublicKeyRepository) List() ([]*domain.LinkedPublicKey, error) { | ||
return nil, errors.New("not implemented") | ||
} | ||
|
||
func (m *PublicKeyRepository) ListByPublicKey(publicKey domain.PublicKey) ([]*domain.LinkedPublicKey, error) { | ||
return nil, errors.New("not implemented") | ||
} | ||
|
||
func (m *PublicKeyRepository) ListByAccountID(accountID accounts.AccountID) ([]*domain.LinkedPublicKey, error) { | ||
return nil, errors.New("not implemented") | ||
} | ||
|
||
func (m *PublicKeyRepository) Count() (int, error) { | ||
return 0, errors.New("not implemented") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package mocks | ||
|
||
import ( | ||
"github.com/planetary-social/nos-crossposting-service/service/app" | ||
) | ||
|
||
type Publisher struct { | ||
} | ||
|
||
func NewPublisher() *Publisher { | ||
return &Publisher{} | ||
} | ||
|
||
func (p *Publisher) PublishTweetCreated(event app.TweetCreatedEvent) error { | ||
return nil | ||
} |
Oops, something went wrong.