clear_report_cache = { label = "Clear Report Cache" shortcut = "crc" requires_profile = true parameters = { } expression = ` # Delete the ProfileCache subdirectory for this profile string profile_cache_directory = LOGANALYSISINFO_DIRECTORY . "ProfileCache" . internal.directory_divider . internal.profile_name; echo("Deleting directory: " . profile_cache_directory); delete_directory(profile_cache_directory); # Delete the profiles_cache subdirectory for this profile string profiles_cache_directory = LOGANALYSISINFO_DIRECTORY . "profiles_cache" . internal.directory_divider . internal.profile_name; echo("Deleting directory: " . profiles_cache_directory); delete_directory(profiles_cache_directory); # Delete the ReportCache subdirectory for this profile string report_cache_directory = LOGANALYSISINFO_DIRECTORY . "ReportCache" . internal.directory_divider . internal.profile_name; echo("Deleting directory: " . report_cache_directory); delete_directory(report_cache_directory); # Delete all tables beginning with "rep_" v.dircontents = ''; string tables_directory = LOGANALYSISINFO_DIRECTORY . "Databases" . internal.directory_divider . internal.profile_name . internal.directory_divider . "main" . internal.directory_divider . "Tables"; #string tables_directory = LOGANALYSISINFO_DIRECTORY . "Tables" . internal.directory_divider . internal.profile_name; #echo("tables_directory: " . tables_directory); get_directory_contents(tables_directory, 'v.dircontents'); #echo("dircontents: " . node_as_string('v.dircontents')); node item; foreach item 'v.dircontents' ( # echo("item.name: " . @item{'pathname'}); if (matches_regular_expression(@item{'label'}, '^rep_')) then ( echo("Deleting report table: " . @item{'pathname'}); delete_directory(@item{'pathname'}); ); ); echo("Cleared report cache for " . internal.profile_name); ` } # clear_report_cache