refactor: improve redis client and publisher

- Refactor the redis client to use a mutex for thread safety.
- Improve error handling in context and playbook factory.
- Remove the play_mdbook command and associated tests.
- Add play_publisher command and tests for publishing books.
- Update the repository cache to use a reference to the redis client.

Co-authored-by: mahmmoud.hassanein <mahmmoud.hassanein@gmail.com>
This commit is contained in:
2025-01-13 16:52:21 +02:00
parent da2881f973
commit 91f8520229
15 changed files with 478 additions and 244 deletions

View File

@@ -70,8 +70,8 @@ pub fn (mut self Context) redis() !&redisclient.Redis {
// make sure we are on the right db
r.selectdb(int(self.config.id))!
}
self.redis_ = &r
&r
self.redis_ = r
r
}
return r2