Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
29e8fe79
Commit
29e8fe79
authored
2 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
fix types
parent
baf3a607
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mol-task/util/user-timing.ts
+1
-1
1 addition, 1 deletion
src/mol-task/util/user-timing.ts
src/servers/model/utils/fetch-retry.ts
+2
-1
2 additions, 1 deletion
src/servers/model/utils/fetch-retry.ts
with
3 additions
and
2 deletions
src/mol-task/util/user-timing.ts
+
1
−
1
View file @
29e8fe79
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
import
{
Task
}
from
'
../task
'
;
import
{
Task
}
from
'
../task
'
;
import
{
isProductionMode
}
from
'
../../mol-util/debug
'
;
import
{
isProductionMode
}
from
'
../../mol-util/debug
'
;
const
hasPerformance
=
(
typeof
performance
!==
'
undefined
'
)
&&
performance
.
mark
&&
performance
.
measure
;
const
hasPerformance
=
(
typeof
performance
!==
'
undefined
'
)
&&
!!
performance
.
mark
&&
performance
.
measure
;
const
timingEnabled
=
hasPerformance
&&
!
isProductionMode
;
const
timingEnabled
=
hasPerformance
&&
!
isProductionMode
;
export
namespace
UserTiming
{
export
namespace
UserTiming
{
...
...
This diff is collapsed.
Click to expand it.
src/servers/model/utils/fetch-retry.ts
+
2
−
1
View file @
29e8fe79
...
@@ -19,7 +19,8 @@ function isRetriableNetworkError(error: any) {
...
@@ -19,7 +19,8 @@ function isRetriableNetworkError(error: any) {
export
async
function
fetchRetry
(
url
:
string
,
timeout
:
number
,
retryCount
:
number
,
onRetry
?:
()
=>
void
):
Promise
<
Response
>
{
export
async
function
fetchRetry
(
url
:
string
,
timeout
:
number
,
retryCount
:
number
,
onRetry
?:
()
=>
void
):
Promise
<
Response
>
{
const
controller
=
new
AbortController
();
const
controller
=
new
AbortController
();
const
id
=
setTimeout
(()
=>
controller
.
abort
(),
timeout
);
const
id
=
setTimeout
(()
=>
controller
.
abort
(),
timeout
);
const
result
=
await
retryIf
(()
=>
fetch
(
url
,
{
signal
:
controller
.
signal
}),
{
const
signal
=
controller
.
signal
as
any
;
// TODO: fix type
const
result
=
await
retryIf
(()
=>
fetch
(
url
,
{
signal
}),
{
retryThenIf
:
r
=>
r
.
status
===
408
/** timeout */
||
r
.
status
===
429
/** too many requests */
||
(
r
.
status
>=
500
&&
r
.
status
<
600
),
retryThenIf
:
r
=>
r
.
status
===
408
/** timeout */
||
r
.
status
===
429
/** too many requests */
||
(
r
.
status
>=
500
&&
r
.
status
<
600
),
// TODO test retryCatchIf
// TODO test retryCatchIf
retryCatchIf
:
e
=>
isRetriableNetworkError
(
e
),
retryCatchIf
:
e
=>
isRetriableNetworkError
(
e
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment