Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tangled
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eriksson monteiro
tangled
Commits
1c7864ab
Commit
1c7864ab
authored
Jun 20, 2022
by
Eriksson Monteiro
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git01.404publishing.com:eriksson_monteiro/tangled into HEAD
parents
1a0d9e6d
c6a1d73d
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
13 deletions
+32
-13
chrome/browser/resources/millix/millix_ws.js
chrome/browser/resources/millix/millix_ws.js
+6
-6
millix_node/tangled-advertisement.js
millix_node/tangled-advertisement.js
+26
-7
No files found.
chrome/browser/resources/millix/millix_ws.js
View file @
1c7864ab
...
...
@@ -33,14 +33,14 @@ class _API {
try
{
return
fetch
(
`
${
_API
.
HOST
}
`
)
.
then
(
response
=>
{
if
(
this
.
apiHealthCheckFail
>=
3
)
{
if
(
this
.
apiHealthCheckFail
>=
4
)
{
window
.
parent
.
postMessage
({
type
:
'
node_restarted
'
},
'
tangled://millix-bar
'
);
}
this
.
apiHealthCheckFail
=
0
;
return
response
.
json
();
}).
catch
(
e
=>
{
this
.
apiHealthCheckFail
++
;
if
(
this
.
apiHealthCheckFail
===
3
)
{
if
(
this
.
apiHealthCheckFail
===
4
)
{
window
.
parent
.
postMessage
({
type
:
'
node_error
'
},
'
tangled://millix-bar
'
);
}
throw
e
;
...
...
@@ -217,8 +217,8 @@ let apiCheckHandlerID = null;
function
apiCheck
()
{
apiCheckHandlerID
=
true
;
API
.
apiHealthCheck
()
.
then
(()
=>
apiCheckHandlerID
=
setTimeout
(()
=>
apiCheck
(),
10
00
))
.
catch
(()
=>
apiCheckHandlerID
=
setTimeout
(()
=>
apiCheck
(),
10
00
));
.
then
(()
=>
apiCheckHandlerID
=
setTimeout
(()
=>
apiCheck
(),
25
00
))
.
catch
(()
=>
apiCheckHandlerID
=
setTimeout
(()
=>
apiCheck
(),
25
00
));
}
window
.
addEventListener
(
'
message
'
,
({
data
})
=>
{
...
...
@@ -269,11 +269,11 @@ window.addEventListener('message', ({ data }) => {
break
;
case
'
request_advertisement_payment
'
:
API
.
requestAdvertisementPayment
(
data
.
queue_id
)
.
then
(
_
=>
_
);
.
then
(
_
=>
_
);
break
;
case
'
api_check
'
:
if
(
!
apiCheckHandlerID
)
{
apiCheck
();
setTimeout
(()
=>
apiCheck
(),
15000
);
// start api check after 15s
}
break
;
}
...
...
millix_node/tangled-advertisement.js
View file @
1c7864ab
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment