Skip to content

Commit b4be492

Browse files
committed
improve serialization for workflow interrupt
1 parent becae67 commit b4be492

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Workflow/Persistence/DatabasePersistence.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ public function save(string $workflowId, WorkflowInterrupt $interrupt): void
3030

3131
$stmt->execute([
3232
'id' => $workflowId,
33-
'interrupt' => serialize($interrupt),
33+
'interrupt' => base64_encode(
34+
serialize($interrupt)
35+
), // Simple Base64 string is compatible with all databases
3436
]);
3537
}
3638

src/Workflow/Persistence/EloquentPersistence.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function save(string $workflowId, WorkflowInterrupt $interrupt): void
2929
], [
3030
'interrupt' => base64_encode(
3131
serialize($interrupt)
32-
), // Base64 is better suited for some database types (like CockroachDB)
32+
), // Simple Base64 string is compatible with all databases
3333
]);
3434
}
3535

0 commit comments

Comments
 (0)