This repository was archived by the owner on Jun 27, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,14 @@ function createUploadDirIfNeeded () {
17
17
}
18
18
}
19
19
20
- class SaveRemoveImage {
21
- constructor ( hook ) {
22
- this . hook = hook ;
23
- }
24
- uploadBlob ( ) {
25
-
26
- }
27
- }
20
+ // lass SaveRemoveImage {
21
+ // constructor (hook) {
22
+ // this.hook = hook;
23
+ // }
24
+ // uploadBlob () {
25
+ //
26
+ // }
27
+ //
28
28
29
29
module . exports = function ( options = [ ] ) { // eslint-disable-line no-unused-vars
30
30
return function async ( hook ) {
@@ -53,7 +53,7 @@ module.exports = function (options = []) { // eslint-disable-line no-unused-vars
53
53
// hook.app.debug(`cancel on invalid image url: ${hook.data[field]}`);
54
54
// return;
55
55
// }
56
- hook . app . debug ( `###try to get image: ${ hook . data [ field ] } ` ) ;
56
+ // hook.app.debug(`###try to get image: ${hook.data[field]}`);
57
57
58
58
loading ++ ;
59
59
imgCount ++ ;
@@ -82,22 +82,22 @@ module.exports = function (options = []) { // eslint-disable-line no-unused-vars
82
82
reject ( err ) ;
83
83
}
84
84
} else if ( validUrl . isUri ( hook . data [ field ] ) ) {
85
- hook . app . debug ( 'SAVE REMOTE IMAGES HOOK' ) ;
86
- hook . app . debug ( `###request url: ${ hook . data [ field ] } ` ) ;
85
+ // hook.app.debug('SAVE REMOTE IMAGES HOOK');
86
+ // hook.app.debug(`###request url: ${hook.data[field]}`);
87
87
request ( {
88
88
url : hook . data [ field ] ,
89
89
encoding : null ,
90
- timeout : 15000
90
+ timeout : 30000
91
91
} , ( err , res , body ) => {
92
92
if ( err ) {
93
93
hook . app . error ( err ) ;
94
94
reject ( err ) ;
95
95
}
96
- hook . app . debug ( `###got answer for: ${ hook . data [ field ] } ` ) ;
96
+ // hook.app.debug(`###got answer for: ${hook.data[field]}`);
97
97
try {
98
98
const mimeType = res . headers [ 'content-type' ] ;
99
99
if ( mimeType . indexOf ( 'image' ) !== 0 ) {
100
- hook . app . log ( '~~~~~its not an image' ) ;
100
+ // hook.app.log('~~~~~its not an image');
101
101
reject ( 'its not an image' ) ;
102
102
}
103
103
You can’t perform that action at this time.
0 commit comments