Commit 9dd4eac
Sorra
SB-0MN77JYZ513EIHHI: Extract LifecycleManager module from src/index.ts
- Create LifecycleManager class with comprehensive startup/shutdown lifecycle management
- Move startup notifications, recovery, and status restoration into dedicated module
- Implement graceful shutdown handling with SIGTERM/SIGINT signal handlers
- Add status message cleanup and lost item recovery on shutdown
- Add STARTUP_NOTIFICATION_CHANNEL_ID config option to bot.ts
- Replace inline startup/shutdown logic in index.ts with LifecycleManager integration
- Create comprehensive unit tests (30 test cases) for LifecycleManager
- Maintain backward compatibility through legacy exports
All 162 tests passing.1 parent b690803 commit 9dd4eac
5 files changed
Lines changed: 1054 additions & 4 deletions
File tree
- src
- config
- lifecycle
- tests/lifecycle
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
2139 | 2138 | | |
2140 | 2139 | | |
2141 | 2140 | | |
2142 | | - | |
2143 | | - | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
2144 | 2184 | | |
2145 | 2185 | | |
2146 | 2186 | | |
| 2187 | + | |
0 commit comments