Skip to content
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

Add check to see if Islandora host is running and responding #10

Closed
mjordan opened this issue Aug 16, 2019 · 2 comments
Closed

Add check to see if Islandora host is running and responding #10

mjordan opened this issue Aug 16, 2019 · 2 comments
Labels
bug Something isn't working question Further information is requested

Comments

@mjordan
Copy link
Owner

mjordan commented Aug 16, 2019

The workbench script performs this check but we probably should do it in desktop too so it's easier to display a nice warning to the user. We need to check both that Islandora is up and running and that the credientials provided in the config file are valid.

Idea here is that if Islandora is not responding, Workbench Desktop should not call the python script but should tell the user to investigate.

@mjordan mjordan added the enhancement New feature or request label Aug 16, 2019
mjordan added a commit that referenced this issue Aug 17, 2019
mjordan added a commit that referenced this issue Aug 19, 2019
@mjordan
Copy link
Owner Author

mjordan commented Aug 19, 2019

I obviously don't understand how try/catch works in Javascript, even though it's supposed to work the same as in other languages. This function returns true when Islandora is not responding:

/**
 * Returs true if we can connect and log into Islandora, false otherwise.
 *
 * Does not currently work.
 */
function ping_islandora(config) {
  var http = require('http');
  http.get('http://localhost:800', function (res) {
    // @todo: Check response code, etc.
  }).on('error', function(e) {
    return false;
  });
  // @todo: Log in to make sure that credentials are valid.

  console.log("DEBUG: Reached end of ping_islandora function.")
  return true;
}

If anyone can point out why this is, I'd love to know.

I'm merging the issue-10 branch into master since I hope all we need to do is get this function to work as intended.

@mjordan mjordan added bug Something isn't working question Further information is requested and removed enhancement New feature or request labels Aug 19, 2019
@mjordan
Copy link
Owner Author

mjordan commented Aug 22, 2019

Resolved with 52b4d70. Thanks a million @seth-shaw-unlv !

@mjordan mjordan closed this as completed Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant