Unverified Commit 362774d8 authored by Mark Beamer Jr's avatar Mark Beamer Jr
Browse files

test

parent e65d2261
Pipeline #436 failed with stage
in 1 minute and 54 seconds
......@@ -67,7 +67,7 @@ mysql -u lbry -plbry -D lbry -h "127.0.0.1" -P 15500 -e "$ADDYTCHANNEL"
# Execute the test!
sudo -E ./../bin/ytsync --channelID UCCyr5j8akeu9j4Q7urV0Lqw #Force channel intended...just in case. This channel lines up with the api container
./../bin/ytsync --channelID UCCyr5j8akeu9j4Q7urV0Lqw #Force channel intended...just in case. This channel lines up with the api container
# Assert the status
status=$(mysql -u lbry -plbry -ss -D lbry -h "127.0.0.1" -P 15500 -e 'SELECT status FROM youtube_data WHERE id=1')
videoStatus=$(mysql -u lbry -plbry -ss -D lbry -h "127.0.0.1" -P 15500 -e 'SELECT status FROM synced_video WHERE id=1')
......
......@@ -112,7 +112,7 @@ func (s *SyncManager) Start() error {
for {
err := s.checkUsedSpace()
if err != nil {
return err
return errors.Err(err)
}
var syncs []Sync
......@@ -122,7 +122,7 @@ func (s *SyncManager) Start() error {
if isSingleChannelSync {
channels, err := s.apiConfig.FetchChannels("", s.syncProperties)
if err != nil {
return err
return errors.Err(err)
}
if len(channels) != 1 {
return errors.Err("Expected 1 channel, %d returned", len(channels))
......
......@@ -289,6 +289,10 @@ func (s *Sync) FullCycle() (e error) {
if err != nil {
return errors.Wrap(err, 0)
}
err = os.Chmod(s.videoDirectory, 0766)
if err != nil {
return errors.Err(err)
}
defer deleteSyncFolder(s.videoDirectory)
log.Printf("Starting daemon")
......
......@@ -71,7 +71,7 @@ func (a *APIConfig) FetchChannels(status string, cp *SyncProperties) ([]YoutubeC
var response apiJobsResponse
err = json.Unmarshal(body, &response)
if err != nil {
return nil, err
return nil, errors.Err(err)
}
if response.Data == nil {
return nil, errors.Err(response.Error)
......@@ -152,7 +152,7 @@ func (a *APIConfig) SetChannelStatus(channelID string, status string, failureRea
var response apiChannelStatusResponse
err := json.Unmarshal(body, &response)
if err != nil {
return nil, nil, err
return nil, nil, errors.Err(err)
}
if !response.Error.IsNull() {
return nil, nil, errors.Err(response.Error.String)
......
......@@ -178,7 +178,7 @@ func (v *YoutubeVideo) getAbbrevDescription() string {
func (v *YoutubeVideo) download(useIPv6 bool) error {
videoPath := v.getFullPath()
err := os.Mkdir(v.videoDir(), 0750)
err := os.Mkdir(v.videoDir(), 0777)
if err != nil && !strings.Contains(err.Error(), "file exists") {
return errors.Wrap(err, 0)
}
......@@ -310,6 +310,10 @@ runcmd:
if err != nil {
return errors.Err(err)
}
err = os.Chmod(v.getFullPath(), 0777)
if err != nil {
return errors.Err(err)
}
videoSize := fi.Size()
v.size = &videoSize
return nil
......
......@@ -25,7 +25,7 @@ const thumbnailPath = "/tmp/ytsync_thumbnails/"
const ThumbnailEndpoint = "https://thumbnails.lbry.com/"
func (u *thumbnailUploader) downloadThumbnail() error {
_ = os.Mkdir(thumbnailPath, 0750)
_ = os.Mkdir(thumbnailPath, 0777)
img, err := os.Create("/tmp/ytsync_thumbnails/" + u.name)
if err != nil {
return errors.Err(err)
......
......@@ -166,7 +166,7 @@ func CleanForStartup() error {
err = CleanupLbrynet()
if err != nil {
return err
return errors.Err(err)
}
lbrycrd, err := GetLbrycrdClient(os.Getenv("LBRYCRD_STRING"))
......@@ -187,7 +187,11 @@ func CleanForStartup() error {
}
defaultWalletDir := GetDefaultWalletPath()
return os.Remove(defaultWalletDir)
_, err = os.Stat(defaultWalletDir)
if os.IsNotExist(err) {
return nil
}
return errors.Err(os.Remove(defaultWalletDir))
}
func CleanupLbrynet() error {
......@@ -215,7 +219,7 @@ func CleanupLbrynet() error {
if err != nil {
return errors.Err(err)
}
err = os.Mkdir(blobsDir, 0755)
err = os.Mkdir(blobsDir, 0777)
if err != nil {
return errors.Err(err)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment