Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Commit

Permalink
check if repo actually has a last sync timestamp
Browse files Browse the repository at this point in the history
Closes: #25
  • Loading branch information
evgeni committed Mar 14, 2017
1 parent 1ca4746 commit a87df29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cvmanager
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def publish()
# get repo data
repo = @api.resource(:repositories).call(:show, {:id => repo_id})
# check if the last sync has been ever completed
if repo.has_key?('last_sync') and repo['last_sync'].has_key?('ended_at') and repo['last_sync']['ended_at']
if repo.has_key?('last_sync') and repo['last_sync'] and repo['last_sync'].has_key?('ended_at') and repo['last_sync']['ended_at']
# if sync completed, save last end sync time
repo_last_sync = Time.xmlschema(repo['last_sync']['ended_at']) rescue Time.parse(repo['last_sync']['ended_at'])
else
Expand Down

0 comments on commit a87df29

Please sign in to comment.