-
Notifications
You must be signed in to change notification settings - Fork 2.7k
service: storage monitor added #13082
Changes from 1 commit
34577eb
b5f970b
37bbba4
ba0f28f
e360685
fd5679f
217234f
8b3310b
931339c
c200159
f5501f2
45171dc
f346394
eb49400
8619766
a0cd44d
d3f143c
a79af9a
00e7264
6c3eb1c
58dcf55
95b576b
0b8697e
c0fc2ca
de35dda
4e32f3d
0578588
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Storage monitor added. It uses `notify` create to get notifications about any changes to monitored path (which is database path). Notifications are consumed in essential task which terminates when available storage space drops below given threshold. Closes: #12399
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,8 +22,10 @@ use crate::{ | |
| config::{Configuration, KeystoreConfig, PrometheusConfig}, | ||
| error::Error, | ||
| metrics::MetricsService, | ||
| start_rpc_servers, BuildGenesisBlock, GenesisBlockBuilder, RpcHandlers, SpawnTaskHandle, | ||
| TaskManager, TransactionPoolAdapter, | ||
| start_rpc_servers, | ||
| storage_monitor::StorageMonitorService, | ||
| BuildGenesisBlock, GenesisBlockBuilder, RpcHandlers, SpawnTaskHandle, TaskManager, | ||
| TransactionPoolAdapter, | ||
| }; | ||
| use futures::{channel::oneshot, future::ready, FutureExt, StreamExt}; | ||
| use jsonrpsee::RpcModule; | ||
|
|
@@ -534,6 +536,14 @@ where | |
| metrics_service.run(client.clone(), transaction_pool.clone(), network.clone()), | ||
| ); | ||
|
|
||
| if let Some(storage_monitor_service) = StorageMonitorService::new_for_config(&config)? { | ||
| task_manager.spawn_essential_handle().spawn( | ||
|
||
| "storage-monitor", | ||
| None, | ||
| storage_monitor_service.run(), | ||
| ) | ||
| } | ||
|
|
||
| let rpc_id_provider = config.rpc_id_provider.take(); | ||
|
|
||
| // jsonrpsee RPC | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.