Desktop version

Main > Forum > 1C:Enterprise Platform > Studying 1C:Enterprise platform > Running scheduled jobs in File mode

Forum

Search UsersRules
Running scheduled jobs in File mode
#1
Just came
Points:: 0
Joined:: Jul 18, 2012

Good evening!

I'm trying to run scheduled job in infobase created in File mode, but it does not start somewhy. Could someone explain why?

Profile
#2
Active user
Points:: 1
Joined:: Jul 20, 2011

There must be a session to the infobase which will perform background jobs. In Server mode it is created by the 1C:Enterprise server, but in File mode it must be runned manually (or using any automation scripts). This session should check for background jobs to perform by the schedule and perform ones which should to. Here is the code which must be implemented in the Managed application module, which should execute background jobs in File mode:

Code
Procedure OnStart(Cancel)

   If SystemSettingsServerCall.CurrentUserRunsBackgroundJobs() Then
       IdleHandler();
      BackgroundJobsReady = True;
       AttachIdleHandler("IdleHandler", 2);
   EndIf;
   
EndProcedure

Procedure IdleHandler() Export
   
    ProcessJobs(1);
   
EndProcedure

Profile
#3
Guest
Points::
Joined::

You can see more detailed example in the Subsystems Library. There is Scheduled Jobs subsystem which contains ScheduledAndBackgroundJobs data processor and in ScheduledAndBackgroundJobs form there is OpenSeparateSessionOfScheduledJobsProcessing command which opens the separate session for processing background jobs. This is what you need, I believe.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.