Skip to content

Commit

Permalink
#666 Add interval access because extend the session period
Browse files Browse the repository at this point in the history
  • Loading branch information
koda-masaru committed Apr 3, 2017
1 parent 0194e83 commit 03363af
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.support.project.knowledge.control.open;

import org.support.project.di.DI;
import org.support.project.di.Instance;
import org.support.project.knowledge.control.Control;
import org.support.project.web.bean.Msg;
import org.support.project.web.boundary.Boundary;
import org.support.project.web.control.service.Get;
import org.support.project.web.exception.InvalidParamException;

@DI(instance = Instance.Prototype)
public class IntervalControl extends Control {

@Get
public Boundary access() throws InvalidParamException {
return send(new Msg("OK"));
}

}
18 changes: 17 additions & 1 deletion src/main/webapp/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,23 @@ $(document).ready(function() {
}, 500);
return false;
});


// セッションが切れないように、定期的にアクセスする(5分に1回)
var accessInterval = function() {
setInterval(() => {
var url = _CONTEXT + '/open.interval/access';
$.ajax({
type : 'GET',
url : url
}).done(function(result, textStatus, xhr) {
console.log('OK');
}).fail(function(xhr, textStatus, error) {
console.error(error);
}).always(function( jqXHR, textStatus ) {
});
}, 1000 * 60 * 5);
};
accessInterval();
});
function logging(str, level) {
// console.log(str);
Expand Down

0 comments on commit 03363af

Please sign in to comment.