Created
September 23, 2016 02:53
-
-
Save timothycrosley/a5e6070a29870d0a44d9e37db6675e3b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sh import zfs_scrub, do_scrub | |
@hug.cli() | |
def do_scrub(): | |
for output in zfs_scrub(''): | |
cache.set('key', output.split('%')[0].split(' ')[-1]) | |
cache.set('key', 'done') | |
@hug.post() | |
def start_scrub(): | |
do_scrub(_bg=True) | |
@hug.get() | |
def get_scrub_status(): | |
return cache.get('key') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment