Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Alexander
/
alex-hunter-sales-dev
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8d9fb1bf
authored
Dec 04, 2022
by
Nick N. Sukharev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Отправка файла на Googlr Disk изменена с синхронной на асинхронную
1 parent
a1b08947
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
shared.js
shared.js
View file @
8d9fb1b
...
@@ -219,18 +219,24 @@ module.exports = exports = {
...
@@ -219,18 +219,24 @@ module.exports = exports = {
},
},
send_to_google_disk
(
file_name
,
file_mime
)
{
send_to_google_disk
(
file_name
,
file_mime
)
{
let
proc
=
sys
.
spawnSync
(
'php'
,
[
file_sender
,
file_name
,
file_mime
]);
const
sender
=
sys
.
spawn
(
'php'
,
[
file_sender
,
file_name
,
file_mime
]);
let
exit_code
=
proc
.
status
;
sender
.
on
(
"close"
,
(
code
)
=>
{
let
look_stdout
=
proc
.
stdout
.
toString
();
if
(
code
!=
0
)
console
.
log
(
"send 'file_name' to google disk return code: "
+
code
);
});
let
check_error
=
proc
.
error
;
sender
.
on
(
"error"
,
(
error
)
=>
{
let
look_stderr
=
proc
.
stderr
.
toString
();
console
.
log
(
"send to google disk error: \n"
+
JSON
.
stringify
(
error
,
undefined
,
2
));
});
sender
.
stderr
.
on
(
"data"
,
(
data
)
=>
{
console
.
log
(
"send to google disk stderr: \n"
+
data
);
});
if
(
check_error
)
sender
.
stdout
.
on
(
"data"
,
(
data
)
=>
{
console
.
log
(
"error: \n"
+
JSON
.
stringify
(
check_error
,
undefined
,
2
));
console
.
log
(
"send to google disk stdout: \n"
+
data
);
if
(
look_stderr
)
console
.
log
(
"stderr: \n"
+
look_stderr
);
});
if
(
look_stdout
)
console
.
log
(
"stdout: \n"
+
look_stdout
);
},
},
is_mobile_code
(
abonent_phone
)
{
is_mobile_code
(
abonent_phone
)
{
...
@@ -352,4 +358,4 @@ module.exports = exports = {
...
@@ -352,4 +358,4 @@ module.exports = exports = {
};
};
}
}
};
};
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment