Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • G git-backup
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • git-backup
  • Repository
  • git-backup
  • git.go
Find file BlameHistoryPermalink
  • Kirill Smelkov's avatar
    *: Add cancellation handling via contexts · 540f0ead
    Kirill Smelkov authored Jan 13, 2020
    Add ctx parameter to cmd_pull, cmd_restore and inner functions that they
    call that can block and handle ctx cancel where we can. For now both
    pull and restore are always run under background context, but in the
    next patch we'll connect SIGINT+SIGTERM to cancel spawned work.
    
    In general a service - even a command line utility - needs to handle
    cancellation properly and itself to maintain consistency of external
    state. See e.g.
    
    	https://callistaenterprise.se/blogg/teknik/2019/10/05/go-worker-cancellation/
    
    for example.
    540f0ead
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7