mirror of
https://github.com/storytold/EventCenterPlugin.git
synced 2026-11-20 17:10:42 +01:00
Can't reconnect to Redis, and it randomly dies... ugh
The pattern of unsubscribe/subscribe seems to segfault, as do reconnect, etc. This Redis plugin isn't durable.
This commit is contained in:
1 parent
89ecad04fe
commit
8c5537c33d
2 files changed
+14
No files matched your search
@@ -34,6 +34,7 @@ void AEventSourceActor::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, "BeginPlay() - 2");
|
||||
UE_LOG(EventSourceLog, Log, TEXT("BeginPlay()"));
|
||||
|
||||
if (redis == nullptr) {
|
||||
@@ -55,6 +56,16 @@ void AEventSourceActor::BeginDestroy()
|
||||
void AEventSourceActor::Tick(float DeltaTime)
|
||||
{
|
||||
Super::Tick(DeltaTime);
|
||||
|
||||
float time = GetGameTimeSinceCreation();
|
||||
|
||||
if (time - timerLastTime > 15.0) {
|
||||
timerLastTime = time;
|
||||
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, "seconds elapsed");
|
||||
redis->Unsubscribe(TEXT("second"));
|
||||
redis->Subscribe(TEXT("second"));
|
||||
}
|
||||
|
||||
|
||||
// NB: Handled by RedisObject internal delegate
|
||||
//redis->Tick(DeltaTime);
|
||||
|
||||
Reference in new issue
Block a user