@@ -923,6 +923,14 @@ class SocrataSearchNode:
923
923
default_value = "Massachusetts" ,
924
924
)
925
925
926
+ timeout = knext .IntParameter (
927
+ label = "Request timeout in seconds" ,
928
+ description = "The timeout in seconds for the request API." ,
929
+ default_value = 120 ,
930
+ min_value = 1 ,
931
+ is_advanced = True ,
932
+ )
933
+
926
934
def configure (self , configure_context ):
927
935
# TODO Create combined schema
928
936
return None
@@ -940,7 +948,7 @@ def execute(self, exec_context: knext.ExecutionContext):
940
948
f"http://api.us.socrata.com/api/catalog/v1?q={ encoded_query_item } &only=datasets&limit=10000"
941
949
)
942
950
943
- response = urlopen (request )
951
+ response = urlopen (request , timeout = self . timeout )
944
952
response_body = response .read ()
945
953
946
954
# Load the JSON response into a Python dictionary
@@ -1043,7 +1051,15 @@ class SocrataDataNode:
1043
1051
default_value = "" ,
1044
1052
)
1045
1053
1046
- def configure (self , configure_context ):
1054
+ timeout = knext .IntParameter (
1055
+ label = "Request timeout in seconds" ,
1056
+ description = "The timeout in seconds for the request API." ,
1057
+ default_value = 120 ,
1058
+ min_value = 1 ,
1059
+ is_advanced = True ,
1060
+ )
1061
+
1062
+ def configure (self , configure_context , input_schema_1 ):
1047
1063
# TODO Create combined schema
1048
1064
return None
1049
1065
@@ -1056,6 +1072,7 @@ def execute(self, exec_context: knext.ExecutionContext):
1056
1072
# Unauthenticated client only works with public data sets. Note 'None'
1057
1073
# in place of application token, and no username or password:
1058
1074
client = Socrata (self .metadata_domain , None )
1075
+ client .timeout = self .timeout
1059
1076
limit = 100000
1060
1077
offset = 0
1061
1078
all_results = []
0 commit comments