^1649333164901
@
sname
ThingDbScanTask
slabel
ThingDbScanTask
sgroup
xworker.ide.background
senable
true
scallback
false
scallbackCancel
false
ssingleInstance
false
ssaveAsGlobalVar
false
sschedule
true
speriod
10000
sfixedRate
false
stimeUnit
MILLISECONDS
sfixTime
false
scalculatePassCount
false
Sdescription
#$@text#$@
<p>扫描已变更的事物并添加到重建事物索引的队列中。</p>

<p><span style="color:rgb(255, 0, 0)"><strong>常驻任务，请勿关闭。</strong></span></p>
#$@text#$@
sinterpretationType
Self
sattributeTemplate
false
schildsAttributeTemplate
false
svarScope
Local
sisSynchronized
false
sthrowException
true
suseOtherAction
false
screateLocalVarScope
false
ssaveReturn
false
sdisableGlobalContext
false
sdebugLog
false
sdescriptors
xworker.lang.task.Task
sinheritDescription
false
sth_createIndex
true
sth_registThing
child|xworker.lang.task.TaskIndex
sth_registMyChilds
false
sth_registDisabled
false
sth_noThingRegistViewer
false
sth_fileMonitor
false
sth_deprecated
false
Sen_description
#$@text#$@
<p>Scan for changed things and add to the queue for reindexing things. </p>

<p><span style="color:rgb(255, 0, 0)"><strong>Permanent tasks, do not close. </strong></span></p>
#$@text#$@
sth_mark
false
sth_registQueryOnlySelf
false
snotXmlAttribute
false
sjson_isArray
false
  @/@actions
  sname
  actions
  sdescriptors
  xworker.ide.worldexplorer.background.BackGroundTask/@actions
  sid
  actions
    @/@actions/@run
    sname
    doTask
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Global
    sdisableGlobalContext
    false
    Scode
#$@text#$@
//暂停该任务，因为要扫描所有事物，因此事物多了太耗资源
return;

//log.info("sacn。。。。。");
def updater = world.getThing("xworker.ide.db.dbindex.actions.ThingIndexUpdater");
updater.doAction("scanUpdated", actionContext);
//log.info("scan end")

//删除更新索引下的空目录
def file = new File(world.getPath() + "/work/updateindex");
if(file.exists()){
    deleteBlankDir(file);
}

def deleteBlankDir(file){   
    if(file.isDirectory()){
        for(childFile in file.listFiles()){
            deleteBlankDir(childFile);
        }
        
        if(file.listFiles().length == 0){
            file.delete();
        }
    }
}
#$@text#$@
    sinterpretationType
    Action
    screateLocalVarScope
    false
    ssaveReturn
    false
    sdebugLog
    false
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sid
    run
