| 761 | |
| 762 | |
| 763 | void StorageLocalResourceProviderProcess::watchResources() |
| 764 | { |
| 765 | // A specified reconciliation interval of zero |
| 766 | // denotes disabled periodic reconciliations. |
| 767 | if (reconciliationInterval == Seconds(0)) { |
| 768 | return; |
| 769 | } |
| 770 | |
| 771 | CHECK(info.has_id()); |
| 772 | |
| 773 | loop( |
| 774 | self(), |
| 775 | std::bind(&process::after, reconciliationInterval), |
| 776 | [this](const Nothing&) { |
| 777 | // Poll resource provider state in `sequence` to |
| 778 | // prevent concurrent non-reconcilable operations. |
| 779 | reconciled = sequence.add(std::function<Future<Nothing>()>( |
| 780 | defer(self(), &Self::reconcileResources, false))); |
| 781 | |
| 782 | return reconciled.then( |
| 783 | [](const Nothing&) -> ControlFlow<Nothing> { return Continue(); }); |
| 784 | }); |
| 785 | } |
| 786 | |
| 787 | |
| 788 | Future<Nothing> StorageLocalResourceProviderProcess::reconcileResources( |