diff --git a/lib/api/source/sync.php b/lib/api/source/sync.php index 032ab37..df100ff 100755 --- a/lib/api/source/sync.php +++ b/lib/api/source/sync.php @@ -30,18 +30,10 @@ return 127; } - /* (4) Decrement the hash */ - $decr = syscall(SOURCE_DIR.'/lib/cyclic-hash/decr'); - - if( $decr === false ){ - slog("cyclic-hash:decr returned $decr EXIT_STATUS", 'api:sync'); - return 127; - } - - /* (5) Generate the multipart boundary */ + /* (4) Generate the multipart boundary */ $boundary = 'boundary--'.hash('sha512', uniqid()).'--boundary'; - /* (6) Fetch data */ + /* (5) Fetch data */ $data = json_decode(syscall(SOURCE_DIR.'/lib/api/fetch')); if( is_null($data) ){ @@ -114,7 +106,15 @@ /* [6] Decrement cyclic-hash so request has ran successfully =========================================================*/ - + /* (1) Decrement the hash */ + $decr = syscall(SOURCE_DIR.'/lib/cyclic-hash/decr'); + + if( $decr === false ){ + slog("cyclic-hash:decr returned $decr EXIT_STATUS", 'api:sync'); + return 127; + } + +