Skip to content

Commit 8a0bbc8

Browse files
committed
Merge branch 'master' into dev
2 parents 3c16f8d + 32986de commit 8a0bbc8

3 files changed

Lines changed: 3 additions & 11 deletions

File tree

server/preprocessing/other-scripts/base.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ blog <- getLogger('api.base')
3838

3939

4040
get_papers <- function(query, params, limit=100,
41-
filter=NULL,
4241
retry_opts=rbace::bs_retry_options(3,60,3,4)) {
4342

4443
blog$info(paste("vis_id:", .GlobalEnv$VIS_ID, "Search:", query))

server/preprocessing/other-scripts/text_similarity.R

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ query <- args[2]
66
service <- args[3]
77
params_file <- args[4]
88

9-
print(wd)
10-
print(query)
11-
print(service)
12-
print(params_file)
13-
149
setwd(wd) #Don't forget to set your working directory
1510

1611
source('../other-scripts/utils.R')
@@ -86,14 +81,10 @@ switch(service,
8681
}
8782
)
8883

89-
print("inhere")
90-
9184
MAX_CLUSTERS = 15
9285
LANGUAGE <- get_service_lang(lang_id, valid_langs, service)
9386
ADDITIONAL_STOP_WORDS = LANGUAGE$name
9487

95-
print("reading stuff")
96-
print(params)
9788
failed <- list(params=params)
9889
tryCatch({
9990
query <- sanitize_query(query)
@@ -105,7 +96,6 @@ tryCatch({
10596
})
10697

10798
if(exists('input_data')) {
108-
print("got the input")
10999
tryCatch({
110100
output_json = vis_layout(input_data$text, input_data$metadata,
111101
service,

server/preprocessing/other-scripts/utils.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ detect_error <- function(failed, service) {
104104
reason <- c(reason, 'API error: timeout')
105105
}
106106
if (length(reason) == 0 && service == 'base') {
107+
if (grepl("Timeout was reached: [api.base-search.net]", failed$query_reason, fixed=TRUE)){
108+
reason <- list('BASE error: timeout')
109+
}
107110
if (grepl("xml_find_first", failed$query_reason, fixed=TRUE)){
108111
reason <- c(reason, 'API error: BASE not reachable')
109112
}

0 commit comments

Comments
 (0)