Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lbry
ytsync
Commits
eb162488
Commit
eb162488
authored
Aug 07, 2019
by
ci
Browse files
improve logging
parent
439ff911
Changes
2
Hide whitespace changes
Inline
Side-by-side
main.go
View file @
eb162488
...
...
@@ -2,6 +2,7 @@ package main
import
(
"fmt"
"github.com/lbryio/lbry.go/extras/errors"
"math/rand"
"os"
"time"
...
...
@@ -194,7 +195,7 @@ func ytSync(cmd *cobra.Command, args []string) {
)
err
:=
sm
.
Start
()
if
err
!=
nil
{
ytUtils
.
SendErrorToSlack
(
err
.
Error
(
))
ytUtils
.
SendErrorToSlack
(
err
ors
.
FullTrace
(
err
))
}
ytUtils
.
SendInfoToSlack
(
"Syncing process terminated!"
)
}
manager/ytsync.go
View file @
eb162488
...
...
@@ -384,7 +384,7 @@ func (s *Sync) stopAndUploadWallet(e *error) {
}
}
func
logShutdownError
(
shutdownErr
error
)
{
logUtils
.
SendErrorToSlack
(
"error shutting down daemon: %
v
"
,
shutdownErr
)
logUtils
.
SendErrorToSlack
(
"error shutting down daemon: %
s
"
,
errors
.
FullTrace
(
shutdownErr
)
)
logUtils
.
SendErrorToSlack
(
"WALLET HAS NOT BEEN MOVED TO THE WALLET BACKUP DIR"
)
}
...
...
@@ -699,7 +699,7 @@ func (s *Sync) startWorker(workerNum int) {
err
:=
s
.
waitForNewBlock
()
if
err
!=
nil
{
s
.
grp
.
Stop
()
logUtils
.
SendErrorToSlack
(
"something went wrong while waiting for a block: %
v
"
,
err
)
logUtils
.
SendErrorToSlack
(
"something went wrong while waiting for a block: %
s
"
,
err
ors
.
FullTrace
(
err
)
)
break
}
}
else
if
util
.
SubstringInSlice
(
err
.
Error
(),
[]
string
{
...
...
@@ -711,7 +711,7 @@ func (s *Sync) startWorker(workerNum int) {
err
:=
s
.
walletSetup
()
if
err
!=
nil
{
s
.
grp
.
Stop
()
logUtils
.
SendErrorToSlack
(
"failed to setup the wallet for a refill: %
v
"
,
err
)
logUtils
.
SendErrorToSlack
(
"failed to setup the wallet for a refill: %
s
"
,
err
ors
.
FullTrace
(
err
)
)
break
}
}
else
if
strings
.
Contains
(
err
.
Error
(),
"Error in daemon: 'str' object has no attribute 'get'"
)
{
...
...
@@ -746,7 +746,7 @@ func (s *Sync) startWorker(workerNum int) {
}
err
=
s
.
Manager
.
apiConfig
.
MarkVideoStatus
(
s
.
YoutubeChannelID
,
v
.
ID
(),
videoStatus
,
existingClaimID
,
existingClaimName
,
err
.
Error
(),
&
existingClaimSize
,
0
)
if
err
!=
nil
{
logUtils
.
SendErrorToSlack
(
"Failed to mark video on the database: %s"
,
err
.
Error
(
))
logUtils
.
SendErrorToSlack
(
"Failed to mark video on the database: %s"
,
err
ors
.
FullTrace
(
err
))
}
}
break
...
...
@@ -937,7 +937,7 @@ func (s *Sync) processVideo(v video) (err error) {
s
.
AppendSyncedVideo
(
v
.
ID
(),
true
,
""
,
summary
.
ClaimName
,
summary
.
ClaimID
,
newMetadataVersion
,
*
v
.
Size
())
err
=
s
.
Manager
.
apiConfig
.
MarkVideoStatus
(
s
.
YoutubeChannelID
,
v
.
ID
(),
VideoStatusPublished
,
summary
.
ClaimID
,
summary
.
ClaimName
,
""
,
v
.
Size
(),
2
)
if
err
!=
nil
{
logUtils
.
SendErrorToSlack
(
"Failed to mark video on the database: %s"
,
err
.
Error
(
))
logUtils
.
SendErrorToSlack
(
"Failed to mark video on the database: %s"
,
err
ors
.
FullTrace
(
err
))
}
return
nil
...
...
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