Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I've been faced with a scenario where we need to do some heavy processing (create zip files) based on data both from custom db-tables and some data stored as Umbraco content (v8). Since the tasks are very heavy and will be long running we don't want to use a single web request to perform the processing. We're looking at something like hangfire, a windows service or a console app - either way the process will not be in the "web context".
I've seen some examples of how to use the Services APIs from a console app like this for example: https://github.com/sitereactor/umbraco-console-example
My problem is that I have some repositories that loads data from the content cache returning IPublishedContent that we convert into our domain model objects, something like:
using (var ctx = _contextFactory.EnsureUmbracoContext())
var myContent = ctx.UmbracoContext.Content.GetByKey(contentKey);
Given this scenario I was hoping for a way to use the Umbraco Content Cache outside of the web context (in a console app or in a Hangfire job). I'm not sure if this is even possible or recommended? Have anyone tried this with success or does anyone have any experience around this?
It does not really matter if the startup of this process is slow since our background task will only run once every week or so.
One solution that I've been thinking about is to perform a API-call from my background-process to get the data that I need - that would also work but I wanted to reach out here before I choose my path forward.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted