Announcement

Collapse
No announcement yet.

Run Delete Product List Cache Entries Scheduled Task from Template

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Run Delete Product List Cache Entries Scheduled Task from Template

    Is there a way to run the Delete Product List Cache Entries scheduled task via SMT code?
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    #2
    Originally posted by Bruce - PhosphorMedia View Post
    Is there a way to run the Delete Product List Cache Entries scheduled task via SMT code?
    For inquiring minds (what's left of mine), what would be the difference in this method and the Scheduled Tasks method? Would this be similar to how many of Bill's modules had a process triggered when a certain screen was clicked on?
    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: X | Facebook | Pinterest

    Comment


      #3
      For example, I created a price updating feature via SMT. However, they have to remember to go find and run the Delete Cache to see changes (or wait until its scheduled run time). I want to be able to call it after the script runs, like Scheduled_Task('Delete Cached Product List')
      Bruce Golub
      Phosphor Media - "Your Success is our Business"

      Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
      phosphormedia.com

      Comment


        #4
        The Standard Scheduled Tasks module is in the LSK, and so is the library code for functions like CachedProductListList_Load_OlderThan() and CachedProductList_Delete(). I bet you can just write this functionality into your template with a couple of mvt:do's.
        Kent Multer
        Magic Metal Productions
        http://TheMagicM.com
        * Web developer/designer
        * E-commerce and Miva
        * Author, The Official Miva Web Scripting Book -- available on-line:
        http://www.amazon.com/exec/obidos/IS...icmetalproducA

        Comment


          #5
          Kent beat me to it.

          Also, I was just looking up some functions for something else and allowed myself to be distracted. These functions are in the LSK under the LSK LIB folder, there are two subfolders, and the filenames start with "cachedproduct...." etc.

          Scott
          Need to offer Shipping Insurance?
          Interactive Design Solutions https://www.myids.net
          MivaMerchant Business Partner | Certified MivaMerchant Web Developer
          Competitive Rates, Custom Modules and Integrations, Store Integration
          AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
          My T-shirt Collection is mostly MivaCon T-shirts!!

          Comment


            #6
            Writes on Post it Note: "Update Local LSK Directory".....
            Bruce Golub
            Phosphor Media - "Your Success is our Business"

            Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
            phosphormedia.com

            Comment


              #7
              You could give the scheduled task a trigger and in the template code you could do an mvt:do to call ScheduledTask_Trigger( 'trigger_code' ). This will cause the scheduled task to run trigger delay seconds from now.
              David Carver
              Miva, Inc. | Software Developer

              Comment


                #8
                Originally posted by dcarver View Post
                You could give the scheduled task a trigger and in the template code you could do an mvt:do to call ScheduledTask_Trigger( 'trigger_code' ). This will cause the scheduled task to run trigger delay seconds from now.
                This sounds like something I would love to learn how to do. I have store owners that are constantly adding products but forget about that cache.
                Leslie Kirk
                Miva Certified Developer
                Miva Merchant Specialist since 1997
                Previously of Webs Your Way
                (aka Leslie Nord leslienord)

                Email me: [email protected]
                www.lesliekirk.com

                Follow me: X | Facebook | Pinterest

                Comment


                  #9
                  Originally posted by dcarver View Post
                  You could give the scheduled task a trigger and in the template code you could do an mvt:do to call ScheduledTask_Trigger( 'trigger_code' ). This will cause the scheduled task to run trigger delay seconds from now.
                  Perfect. Thanks David!
                  Bruce Golub
                  Phosphor Media - "Your Success is our Business"

                  Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                  phosphormedia.com

                  Comment


                    #10
                    Originally posted by dcarver View Post
                    You could give the scheduled task a trigger and in the template code you could do an mvt:do to call ScheduledTask_Trigger( 'trigger_code' ). This will cause the scheduled task to run trigger delay seconds from now.
                    Hmm, it was a late night, but this doesn't appear to work:

                    <mvt:do file="g.Module_Library_DB" name="g.updateCache" value="ScheduledTask_Trigger('PriceUpdater')" />
                    <mvt:if expr="g.updateCache">
                    <p>Updating Page Cache.</p>
                    <mvt:else>
                    <p>Page Cache Not Updated. Please Update manually.</p>
                    </mvt:if>

                    Description: Delete Cached Product List Entries
                    Trigger: PriceUpdater
                    Trigger Delay: 5 second(s)

                    Is the library file correct?
                    Bruce Golub
                    Phosphor Media - "Your Success is our Business"

                    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                    phosphormedia.com

                    Comment


                      #11
                      It's g.Module_Feature_SCH_UT. Search the LSK, you'll find some other places that do it I believe.
                      David Carver
                      Miva, Inc. | Software Developer

                      Comment


                        #12
                        odd...i think my search feature must have taken a vacation yesterday as it didn't turn up anything...now it is...thanks!
                        Bruce Golub
                        Phosphor Media - "Your Success is our Business"

                        Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                        phosphormedia.com

                        Comment


                          #13
                          Originally posted by dcarver View Post
                          You could give the scheduled task a trigger and in the template code you could do an mvt:do to call ScheduledTask_Trigger( 'trigger_code' ). This will cause the scheduled task to run trigger delay seconds from now.
                          I don't know what the spec would be for this. After some testing, it appears that in order to run this trigger function from a template the Scheduled task must explicitly be ENABLED. If my finding is correct, Is there a reason for this? IMO, if the function is written into a template that itself is equal the ENABLE button/switch. Might be worth the discussion. If the function doesn't run when it's expected from coded into a template there is NO feedback for anyone to be able to troubleshoot if the task is switched off inadvertently. It's clearly problematic if the function in the scheduled task might be critical such as pricing or inventory updates.

                          Scott
                          Need to offer Shipping Insurance?
                          Interactive Design Solutions https://www.myids.net
                          MivaMerchant Business Partner | Certified MivaMerchant Web Developer
                          Competitive Rates, Custom Modules and Integrations, Store Integration
                          AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
                          My T-shirt Collection is mostly MivaCon T-shirts!!

                          Comment

                          Working...
                          X