Skip to content

Commit 77ea64d

Browse files
fix: pre-hotreload cartridge support
`crud` module is cartridge-independent in nature, but provides cartridge roles which are the most popular way to setup the module. The roles also not use any modern cartridge features and should work with any cartridge version. But since crud.cfg was introduced [1], it was required to add some code for roles reload [2] proper support. Now cartridge.hotreload module is unconditionally required, so roles cannot be used with cartridge older than 2.4.0. This patch fixes the behavior. 1. 6da4f56 2. tarantool/cartridge@941952e Follows #244
1 parent bd39ec8 commit 77ea64d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Fixed
11+
* Pre-hotreload `cartridge` support (older than 2.4.0) (PR #341).
12+
813
## [1.0.0] - 02-02-23
914

1015
### Added

crud/common/stash.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ stash.name = {
3737
-- @return Returns
3838
--
3939
function stash.setup_cartridge_reload()
40-
local hotreload = require('cartridge.hotreload')
40+
local hotreload_supported, hotreload = pcall(require, 'cartridge.hotreload')
41+
if not hotreload_supported then
42+
return
43+
end
44+
4145
for _, name in pairs(stash.name) do
4246
hotreload.whitelist_globals({ name })
4347
end

0 commit comments

Comments
 (0)