Am 11/12/2015 um 18:32 schrieb Mitchell Joblin:
- Returning NAs often occurs because of problematic characters
in the name string but we don't see the problem until we
try to insert that id into the database which manifests
as a foreign key constrait violation
Signed-off-by: Mitchell Joblin <mitchell.joblin.ext@xxxxxxxxxxx>
---
codeface/R/id_manager.r | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/codeface/R/id_manager.r b/codeface/R/id_manager.r
index fddbe44..7c82e91 100644
--- a/codeface/R/id_manager.r
+++ b/codeface/R/id_manager.r
@@ -76,7 +76,12 @@ query.decompose.user.id.cached <- function(host, port,
pid, name.str) {
}
query.decompose.user.id <- function(conf, name.str) {
- return(query.decompose.user.id.cached(conf$idServiceHostname,
- conf$idServicePort,
- conf$pid, name.str))
+ res <- query.decompose.user.id.cached(conf$idServiceHostname,
+ conf$idServicePort,
+ conf$pid, name.str)
+ if (is.na(res)) {
+ logwarn(sprintf("Id service returning NA for %s", name.str))
+ }
+
+ return(res)
}