Perform fullscan for all DBI tables in a single DB, saving the per-table scans
at location given by `vs`. This func is performed in subprocesses for full DBI stack control.
:param dbconf: config section
:param tab: table name or None to traverse all payload tables
:param ctx: context dict passed to fullscan or None to traverse all contexts
00015 :
00016 """
00017 Perform fullscan for all DBI tables in a single DB, saving the per-table scans
00018 at location given by `vs`. This func is performed in subprocesses for full DBI stack control.
00019
00020 :param dbconf: config section
00021 :param tab: table name or None to traverse all payload tables
00022 :param ctx: context dict passed to fullscan or None to traverse all contexts
00023 """
00024 from DybDbi import gDbi
00025 gDbi.level = 'WARNING'
00026
00027 dbconf, tab, ctx, opts = vs.coords_()
00028
00029 with envvar(DBCONF=dbconf):
00030 db = DB()
00031 ptabs = [tab] if tab else db.showpaytables
00032 for tn in ptabs:
00033 ta = db.tab(tn)
00034 insertdate = ta.vlast('INSERTDATE')
00035 if not insertdate:
00036 log.error("skipping empty table %s " % tn )
00037 continue
00038 ctxs = [ctx] if ctx else ta.actual_ctxs()
00039 for _ctx in ctxs:
00040 v = vs.spawn( ctx=_ctx)
00041 path = v.path
00042
00043 stamp = utc_mtime(path) if os.path.exists(path) else None
00044 if stamp == None or insertdate > stamp or vs.rescan:
00045 log.info("cache miss : fullscan %s %s to %s %s " % (tn, _ctx, path, opts))
00046 fs = ta.fullscan( _ctx , opts )
00047 fss = Scan(fs)
00048 fss.save( path )
00049 if vs.txtscan:
00050 fss.txtsave( path+'txt')
00051 else:
00052 log.info("cached hit : fullscan %s %s %s still valid " % (tn, _ctx, path))
00053