Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't recommend commenting of TaskRecord.create #7

Open
theSteveMitchell opened this issue Sep 26, 2014 · 3 comments
Open

Don't recommend commenting of TaskRecord.create #7

theSteveMitchell opened this issue Sep 26, 2014 · 3 comments

Comments

@theSteveMitchell
Copy link
Owner

In the docs, we say you can have a deploy task run every deploy, if you comment the line that creates the TaskRecord. This is not a good suggestion, since we'll never know if the task ran at all.

  • once we have a PK, we can do something smarter.
@shrirambalakrishnan
Copy link

Asking this out of curiosity. How could a primary key column help us in this situation?

One idea I have is adding a boolean field in task_records table that could be set (or unset if running task during every deploy is not needed) while creating TaskRecord object.

@theSteveMitchell
Copy link
Owner Author

That's a good question. IIRC, I was was wanting to record an id and a date stamp in the database instead of the current scheme of recording only the version number. I think this would still require some Boolean flag, and We could accomplish the same thing without an id, by recording the version number and a date stamp. But I guess the point is, if we run tasks multiple times, I would want some auditing so I know every time it has been run.

In order to do this, I envisioned moving away from the rake DSL and using instead either active record classes or a more rails migration like class. And to me, that implied having an id column. So hopefully that answers your question.

That said, I don't really have a use case for running the same task multiple times. So if you have one, I'd love to hear your thoughts on that

@shrirambalakrishnan
Copy link

Thanks for your detailed description. Your thought process really clarified my doubt. Your idea of moving to rails migration like class for TaskRecord with timestamps and id seems nice to me since it is the convention. The timestamps might just present useful information.

To respond to your query of running the same task multiple times. Have been using your after_party for months and never had a need to run the same task multiple times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants