Created
April 30, 2021 09:23
-
-
Save tuupola/e10990ed707f6a300123e782f8d99143 to your computer and use it in GitHub Desktop.
This file contains 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
while ($worker->work()) { | |
if (1000 < ++$jobs) { | |
print "Job limit reached, exiting worker {$pid}.\n"; | |
$worker->unregisterAll(); | |
exit(); | |
} | |
$memory = memory_get_usage(true); | |
print "Worker {$pid} running job number {$jobs} memory usage is {$memory}.\n"; | |
if (md5_file(__FILE__) !== $md5) { | |
print __FILE__ . " was modified, exiting worker {$pid}.\n"; | |
$worker->unregisterAll(); | |
exit(); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment