@steedos/service-fields-indexs 2.1.108 → 2.1.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-fields-indexs",
3
- "version": "2.1.108",
3
+ "version": "2.1.109",
4
4
  "main": "package.service.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -10,5 +10,5 @@
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
13
- "gitHead": "e9fd695feee86123a7d7d4bd74c5710692f62b13"
13
+ "gitHead": "457a46d3a553c95756eb44162510457b4302ed59"
14
14
  }
@@ -91,10 +91,14 @@ module.exports = {
91
91
  */
92
92
  async started(ctx) {
93
93
  try {
94
+ let indexScheduleCron = "0 0 * * * *"; // 默认每小时执行一次
94
95
  const steedosConfig = objectql.getSteedosConfig() || {};
95
96
  const cron = steedosConfig.cron;
96
97
  if(cron && cron.build_index){
97
- this.job = schedule.scheduleJob(cron.build_index, ()=>{
98
+ indexScheduleCron = cron.build_index;
99
+ }
100
+ if (indexScheduleCron) {
101
+ this.job = schedule.scheduleJob(indexScheduleCron, ()=>{
98
102
  this.broker.call(`${serviceName}.refreshIndexes`)
99
103
  });
100
104
  }