-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add function to get job status #96
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -920,6 +920,52 @@ size_t Jobs_GetJobId( const char * message, | |
return jobIdLength; | ||
} | ||
|
||
size_t Jobs_GetJobStatus( const char * message, | ||
size_t messageLength, | ||
const char ** jobStatus ) | ||
{ | ||
size_t jobStatusLength = 0U; | ||
JSONStatus_t jsonResult = JSONNotFound; | ||
|
||
jsonResult = JSON_Validate( message, messageLength ); | ||
|
||
if( jsonResult == JSONSuccess ) | ||
{ | ||
jsonResult = JSON_SearchConst( message, | ||
messageLength, | ||
"execution.status", | ||
CONST_STRLEN( "execution.status" ), | ||
jobStatus, | ||
&jobStatusLength, | ||
NULL ); | ||
} | ||
|
||
return jobStatusLength; | ||
} | ||
|
||
size_t Jobs_GetJobVersionNumber( const char * message, | ||
size_t messageLength, | ||
const char ** jobVersionNumber ) | ||
{ | ||
size_t jobVersionNumberLength = 0U; | ||
JSONStatus_t jsonResult = JSONNotFound; | ||
|
||
jsonResult = JSON_Validate( message, messageLength ); | ||
|
||
if( jsonResult == JSONSuccess ) | ||
{ | ||
jsonResult = JSON_SearchConst( message, | ||
messageLength, | ||
"execution.versionNumber", | ||
CONST_STRLEN( "execution.versionNumber" ), | ||
jobVersionNumber, | ||
&jobVersionNumberLength, | ||
NULL ); | ||
} | ||
|
||
return jobVersionNumberLength; | ||
} | ||
|
||
size_t Jobs_GetJobDocument( const char * message, | ||
size_t messageLength, | ||
const char ** jobDoc ) | ||
|
@@ -941,4 +987,4 @@ size_t Jobs_GetJobDocument( const char * message, | |
} | ||
|
||
return jobDocLength; | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add an empty line at the bottom of this file? |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,6 +224,20 @@ static JSONStatus_t populateCommonFields( const char * jobDoc, | |
&( result->fileId ) ); | ||
} | ||
|
||
if( jsonResult == JSONSuccess ) | ||
{ | ||
buildIndexedFileQueryString( fileIndex, | ||
"fileType", | ||
8U, | ||
queryString, | ||
&queryStringLength ); | ||
jsonResult = searchUintValue( jobDoc, | ||
jobDocLength, | ||
queryString, | ||
queryStringLength, | ||
&( result->fileType ) ); | ||
Comment on lines
+229
to
+238
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not think that this is standard across all the job documents.
|
||
} | ||
|
||
if( jsonResult == JSONSuccess ) | ||
{ | ||
buildIndexedFileQueryString( fileIndex, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too.