package net.geedge.common;

import net.geedge.api.util.PlaybookRunnable;

import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;

public class Constant {
    /**
     * 临时目录
     */
    public static final String TEMP_PATH = System.getProperty("user.dir") + File.separator + "tmp";

    public static final File PLAYBOOK_AIR_PATH =T.FileUtil.file(T.WebPathUtil.getRootPath(), "tmp" , "playbook", "main.air");

    public static final Map<String, Map> PLAYBOOK_RUN_RESULT = T.MapUtil.newConcurrentHashMap();

    public static final List<PlaybookRunnable> ACTIVE_TASKS = Collections.synchronizedList(new ArrayList<>());

    static {
        File tempPath = T.FileUtil.file(TEMP_PATH);
        // 程序启动清空临时目录
        // T.FileUtil.del(tempPath);
        if (!T.FileUtil.exist(tempPath)) {
            T.FileUtil.mkdir(tempPath);
        }
    }
}