Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Michael Falch Madsen 70 posts 92 karma points
    Dec 21, 2010 @ 14:59
    Michael Falch Madsen
    0

    time consuming function and timeout

    I have a usercontrol which loads +100 xml files and synchronize the nodes with the umbraco tree. It is a time consuming operation and the browser times out.

     

    What is the right way to attack this situation? My first tough was a progress bar but haven’t found any useful pages on google..

    For now I have changed the timeout I web.config to 3hours but I don’t think that’s a pretty way to solve the problem.

    foreach(xmlfile) {

     … sync

    }

     

    Any toughs on best practice to implement time consuming functions In umbraco?

  • Sascha Wolter 615 posts 1101 karma points
    Dec 22, 2010 @ 00:14
    Sascha Wolter
    0

    Hi Michael,

    just my 5 cents:

    - implement as windows app (e.g. service) if possible, as will have quite an impact on the server it's best run at off-peak times

    - definitely use something like a background worker or another low priority thread

    - any chance you can merge the +100 xml files and then do 1 sync with the Umbraco system?

    - if you have to impelement it so it runs in the browser you can nevertheless use a background worker process, providing updates to the user is a must in this case. You can easily optain progress information from the background process and display that, e.g. after each feed done or so.

    Needless to say if you can get around this whole business somehow and do it in another way that might be even easier. E.g. if your website does more than showing the sync'ed feeds you could create a separate app with a separate DAL, you won't have Umbraco nodes this way though, but could write a small dashboard app so users can still work with the data.

    Sascha

  • Chris Koiak 700 posts 2626 karma points
    Dec 22, 2010 @ 11:14
    Chris Koiak
    0

    Nice ideas Sascha,

    I think the background procss or windows service is the way to go.

    You could create an Umbraco scheduled task that reads the XML files into a database. The Umbraco tree could then read directly form the DB, only requesting the child nodes that are required.

    Cheers,

    Chris

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Dec 22, 2010 @ 14:46
    Darren Ferguson
    0

    How about cms import? http://www.cmsimport.com/

  • Michael Falch Madsen 70 posts 92 karma points
    Dec 22, 2010 @ 17:35
    Michael Falch Madsen
    0

    Thanks for your replies.. i did go the background worker way..

Please Sign in or register to post replies

Write your reply to:

Draft