| 660 | } |
| 661 | |
| 662 | void Datastore::writeImage(const std::fs::path& path) |
| 663 | { |
| 664 | Events::OperationStart::post("fluxengine.view.status.writeImage"_lang); |
| 665 | Datastore::runOnWorkerThread( |
| 666 | [=] |
| 667 | { |
| 668 | busy = true; |
| 669 | failed = false; |
| 670 | DEFER(wtOperationStop()); |
| 671 | |
| 672 | try |
| 673 | { |
| 674 | wtRebuildConfiguration(true); |
| 675 | wtWaitForUiThreadToCatchUp(); |
| 676 | globalConfig().setImageWriter(path.string()); |
| 677 | ImageWriter::create(globalConfig()) |
| 678 | ->writeImage(*Datastore::getDisk()->image); |
| 679 | } |
| 680 | catch (...) |
| 681 | { |
| 682 | failed = true; |
| 683 | throw; |
| 684 | } |
| 685 | }); |
| 686 | } |
| 687 | |
| 688 | void Datastore::readImage(const std::fs::path& path) |
| 689 | { |
no test coverage detected