콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3514 화면

Hello Everyone, 

I used yeastar Api to receive all calls in odoo without using odoo VOIP, yeaster Api.


using JS code i trying to make refresh access token every 1800 seconds and refresh every 60 seconds, i used setInterval function by this simple idea to refresh Access Token:

var refresh_access_token = setInterval(function(){ ajax.rpc('get_access_token').then(
function(data){ // data returned from python function..
access_token = data.access_token; // access token returned from py function
interval_time = data.interval_time; // remaining time to refresh access token
}); } , interval_time);

but this idea not work because interval time must be static i think !.  


and for Web Socket i used:

const socket = new WebSocket('wss://some.some.com/openapi/v1.0/subscribe?access_token=' + access_token );
var te=setInterval(function(){
socket.addEventListener('open', (event) => {
socket.send('{"topic_list":[30011,30012]}');
});

console.log("hello from inteval")
},50000);




So gays i need good idea to refresh access token every 1800 seconds, and make wws stable.


Thanks all, 

 


 


아바타
취소
관련 게시물 답글 화면 활동
0
11월 22
2521
2
7월 23
6367
2
8월 22
3405
1
6월 22
4978
1
8월 23
2004