Hey guys I am facing the same issue and the code snippet does nothing , however I found this error in debug log .. I have disabled all other plugins and tried several times and everytime it is the same error , it may help clarify about the issue :
[12-Apr-2017 19:44:57 UTC] PHP Warning: Invalid argument supplied for foreach() in ************/wp-content/plugins/woocommerce/includes/libraries/wp-background-process.php on line 299