Merge pull request #5480 from dataease/pr@dev@fixdatasource

fix: 同步API数据
This commit is contained in:
taojinlong 2023-06-19 17:52:46 +08:00 committed by GitHub
commit f339f56e07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,9 +112,9 @@ public class ExtractDataService {
private Long extractPageSize;
private static final String shellScript = "result=`curl --location-trusted -u %s:%s -H \"label:%s\" -H \"column_separator:%s\" -H \"columns:%s\" -H \"merge_type: %s\" -T %s -XPUT http://%s:%s/api/%s/%s/_stream_load`\n" +
private static final String shellScript = "result=`curl --location-trusted -u %s:%s -H \"label:%s\" -H \"Expect:100-continue\" -H \"column_separator:%s\" -H \"columns:%s\" -H \"merge_type: %s\" -T %s -XPUT http://%s:%s/api/%s/%s/_stream_load`\n" +
"if [ $? -eq 0 ] ; then\n" +
" failstatus=$(echo $result | grep '\"Status\": \"Fail\"')\n" +
" failstatus=$(echo $result | grep '\"status\":\"FAILED\"')\n" +
" if [ \"x${failstatus}\" != \"x\" ];then" +
" echo $result\n" +
" exit 1\n" +
@ -124,10 +124,10 @@ public class ExtractDataService {
" exit 1\n" +
"fi\n";
private static final String shellScriptForDeleteFile = "result=`curl --location-trusted -u %s:%s -H \"label:%s\" -H \"column_separator:%s\" -H \"columns:%s\" -H \"merge_type: %s\" -T %s -XPUT http://%s:%s/api/%s/%s/_stream_load`\n" +
private static final String shellScriptForDeleteFile = "result=`curl --location-trusted -u %s:%s -H \"label:%s\" -H \"Expect:100-continue\" -H \"column_separator:%s\" -H \"columns:%s\" -H \"merge_type: %s\" -T %s -XPUT http://%s:%s/api/%s/%s/_stream_load`\n" +
"rm -rf %s \n" +
"if [ $? -eq 0 ] ; then\n" +
" failstatus=$(echo $result | grep '\"Status\": \"Fail\"')\n" +
" failstatus=$(echo $result | grep '\"status\":\"FAILED\"')\n" +
" if [ \"x${failstatus}\" != \"x\" ];then" +
" echo $result\n" +
" exit 1\n" +