Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Toolchain
sgc
Commits
30d05705
Commit
30d05705
authored
Aug 29, 2020
by
Stefan Galinski
🎮
Browse files
[TASK] Update usage of hirestime
parent
60d9e313
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
core/run.js
core/run.js
+2
-2
core/tasks/css.js
core/tasks/css.js
+2
-2
core/tasks/images.js
core/tasks/images.js
+3
-3
core/tasks/js.js
core/tasks/js.js
+2
-2
No files found.
core/run.js
View file @
30d05705
const
hirestime
=
require
(
'
hirestime
'
);
const
getElapsed
=
hirestime
();
const
getElapsed
=
hirestime
.
default
();
const
cliArguments
=
require
(
'
yargs
'
).
argv
;
const
logger
=
require
(
'
./logger
'
);
const
chalk
=
require
(
'
chalk
'
);
...
...
@@ -43,7 +43,7 @@ class Run {
}
static
processEnd
()
{
logger
.
info
(
`SGC finished after
${
getElapsed
(
hirestime
.
S
)}
s`
,
true
);
logger
.
info
(
`SGC finished after
${
getElapsed
.
s
(
)}
s`
,
true
);
}
}
...
...
core/tasks/css.js
View file @
30d05705
...
...
@@ -32,7 +32,7 @@ module.exports = class Css extends Task {
async
run
(
_subTask
=
null
)
{
return
new
Promise
(
async
resolve
=>
{
const
steps
=
[];
this
.
getElapsed
=
hirestime
();
this
.
getElapsed
=
hirestime
.
default
();
if
(
_subTask
)
{
if
(
_subTask
===
'
qa
'
)
{
steps
.
push
(
this
.
_runQa
());
...
...
@@ -52,7 +52,7 @@ module.exports = class Css extends Task {
steps
.
push
(
this
.
_runCompile
());
}
await
Promise
.
all
(
steps
);
this
.
_logger
.
info
(
`Task
${
chalk
.
bold
(
'
css
'
)}
finished after
${
this
.
getElapsed
(
hirestime
.
S
)}
s`
);
this
.
_logger
.
info
(
`Task
${
chalk
.
bold
(
'
css
'
)}
finished after
${
this
.
getElapsed
.
s
(
)}
s`
);
resolve
();
});
}
...
...
core/tasks/images.js
View file @
30d05705
...
...
@@ -28,7 +28,7 @@ module.exports = class Images extends Task {
this
.
_touchedFiles
=
0
;
this
.
_failedFiles
=
[];
return
new
Promise
(
async
resolve
=>
{
this
.
getElapsed
=
hirestime
();
this
.
getElapsed
=
hirestime
.
default
();
if
(
_subTask
===
'
uploaded
'
)
{
await
this
.
_optimizeUploadedImages
();
}
else
{
...
...
@@ -63,7 +63,7 @@ module.exports = class Images extends Task {
let
messageConfig
=
this
.
_config
.
logMessages
[
'
images:uploadedSuccess
'
];
this
.
_logger
[
messageConfig
.
level
](
messageConfig
.
message
);
}
this
.
_logger
.
info
(
`Task
${
chalk
.
bold
(
'
images
'
)}
finished after
${
this
.
getElapsed
(
hirestime
.
S
)}
s`
);
this
.
_logger
.
info
(
`Task
${
chalk
.
bold
(
'
images
'
)}
finished after
${
this
.
getElapsed
.
s
(
)}
s`
);
resolve
();
});
}
...
...
@@ -87,7 +87,7 @@ module.exports = class Images extends Task {
let
messageConfig
=
this
.
_config
.
logMessages
.
imagesSuccess
;
this
.
_logger
[
messageConfig
.
level
](
messageConfig
.
message
);
}
this
.
_logger
.
info
(
`Task
${
chalk
.
bold
(
'
images
'
)}
finished after
${
this
.
getElapsed
(
hirestime
.
S
)}
s`
);
this
.
_logger
.
info
(
`Task
${
chalk
.
bold
(
'
images
'
)}
finished after
${
this
.
getElapsed
.
s
(
)}
s`
);
resolve
();
});
}
...
...
core/tasks/js.js
View file @
30d05705
...
...
@@ -26,7 +26,7 @@ module.exports = class Js extends Task {
*/
async
run
(
_subTask
=
null
)
{
return
new
Promise
(
async
resolve
=>
{
this
.
getElapsed
=
hirestime
();
this
.
getElapsed
=
hirestime
.
default
();
const
steps
=
[];
if
(
_subTask
)
{
// if _subTask is set, just execute that one task
...
...
@@ -45,7 +45,7 @@ module.exports = class Js extends Task {
steps
.
push
(
this
.
_runCompile
());
}
await
Promise
.
all
(
steps
);
this
.
_logger
.
info
(
`Task
${
chalk
.
bold
(
'
js
'
)}
finished after
${
this
.
getElapsed
(
hirestime
.
S
)}
s`
);
this
.
_logger
.
info
(
`Task
${
chalk
.
bold
(
'
js
'
)}
finished after
${
this
.
getElapsed
.
s
(
)}
s`
);
resolve
();
});
}
...
...
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