17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/smith/doctor/checks/persistence_capabilities.rb', line 17
def run(report)
adapter = resolve_adapter
if adapter.nil?
report.add(
name: "persistence.capabilities",
status: :warn,
message: "No persistence adapter configured",
detail: "Smith.config.persistence_adapter is nil and Smith.config.test_mode is false. " \
"Hosts using durable workflows must set persistence_adapter."
)
return
end
missing = OPTIONAL_CAPABILITIES.reject { |cap| Smith::PersistenceAdapters.supports?(adapter, cap) }
if missing.empty?
report.add(
name: "persistence.capabilities",
status: :pass,
message: "#{adapter.class.name} supports all optional persistence capabilities",
detail: "Supported: #{OPTIONAL_CAPABILITIES.join(', ')}"
)
else
report.add(
name: "persistence.capabilities",
status: :warn,
message: "#{adapter.class.name} missing optional capabilities: #{missing.join(', ')}",
detail: "Workflows using these capabilities fall back to non-versioned writes " \
"with a one-time warning per adapter class. Switch to RedisStore, " \
"ActiveRecordStore (with lock_version column), or the Memory adapter " \
"for full coverage."
)
end
end
|