This is a small tip that I'm mainly publishing as a reminder to myself, but it could come in handy for someone else.
Background processing tasks in ASP.NET are hard. At any time IIS could decide to recycle the application lifecycle. The usual solution is to farm out these tasks to a (Azure) queue and let some other machine (for example an Azure worker role) process that queue.
However, with ASP.NET 4.5.2 Microsoft introduced the QueueBackgroundWorkItem method. This makes it possible to create small background processing tasks within the application lifecycle context.
See the following (extremely simple) example:
Caveats: A task started this way will only delay the recycling of the app pool for 30 seconds. So you need to complete your work within those 30 seconds. If not, the task will be killed.You need ASP.NET 4.5.2.
See for more detail the following links:
When working with Git my normal workflow was to create my feature/bugfix in a branch. When I'm ready to integrate it, I rebase the branch and merge it into master. This ensures that the master branch has a linear history.
This gives you a clean history which is easy to bisect.
However, when reading the help for git merge I came across the --no-ff parameter. It says: Create a merge commit even when the merge resolves as a fast-forward.
I decided to use it for my 0.2 version of my software. This created the following graph in gitk:
This code was first rebased, then merged with git merge --no-ff. An explicit merge commit is now created (where the tag 0.2 points to). Because the branch was already rebased, this merge commit does not contain a diff - it only exists to merge the two branches together.
This gives you several advantages on top of the advantages you have using git rebase: You can see the name of the branch you merged back into master. The name is part of the commit message of…
Suppose you are the integrator of a branch. It is your responsibility to merge different branches from your co-workers. You want to keep a linear history. I.e. you want to avoid this:
Simply configure your master branch like this: git config branch.master.mergeoptions "--ff-only"
Now every time you want to merge a branch that does not create a linear history, you will get the following (rather direct) message: fatal. Not possible to fast-forward, aborting.
Now you can rebase that branch and merge it again (or tell your co-worker to do that for you, the lazy git).
You can configure multiple options: git config branch.master.mergeoptions "--ff-only –-squash"
This configures the branch so that it only accepts a linear history and squashes all commits into a single new commit.
Want to remove these merge options? Simply do: git config --unset branch.master.mergeoptions
Remember that these options are local for your Git repository. You have to r…