taskserver icon indicating copy to clipboard operation
taskserver copied to clipboard

[TD-76] Add basic hook support for taskd

Open taskwarrior opened this issue 7 years ago • 2 comments

Renato Alves on 2014-10-16T10:44:40Z says:

It would be useful to have some of the hooks functionality that is currently being added to the client also available on the server.

The triggers could be:

  • on_sync (after connection initialization and user identification)
  • after_sync (after connection closes)

The first could be used as a permission verification step. If client doesn't meet certain conditions specified in the script, sync would be aborted => script returns exit code 1. Running scripts at sync start is powerful but depending on implementation may require some form of timeout to prevent blocking further syncs.

The second (and the one I currently find most useful) could be used for cleanup, maintenance and backup. For backups in particular, it means I could have something like git tracking the tx.data file and commit after each sync. Very useful to quickly rollback changes.

taskwarrior avatar Feb 11 '18 23:02 taskwarrior

Migrated metadata:

Created: 2014-10-16T10:44:40Z
Modified: 2015-02-28T18:01:44Z

taskwarrior avatar Feb 11 '18 23:02 taskwarrior

Paul Beckingham on 2015-02-28T18:01:44Z says:

Agreed. I would also like to have at least one event that has nothing to do with sync. Perhaps a on-hourly, on-daily, on-weekly, on-monthly or something like that - periodic events. There are possibilities for hooks that scan tasks, perhaps for generating reminders, perhaps for expiration/purge purposes, GC or compaction on the server data etc.

Perhaps on-launch makes sense as well, but on-exit is not necessarily an event we can trap.

Some things (backups) sound like they would be better served by cron.

I've added 'needsDesign' label, because ...

taskwarrior avatar Feb 11 '18 23:02 taskwarrior