Example #1
0
        private static void GarbageCollect(string[] args, Configuration configuration, DateTime timestamp)
        {
            log.Info("garbage collect storage");
            if (args.Length != 2)
            {
                log.Error("wrong number of command line args");
                Environment.Exit(-1);
            }
            DirectoryInfo diTarget = new DirectoryInfo(args[1]);

            if (!diTarget.Exists)
            {
                log.Error("path does not exists " + diTarget.FullName);
                Environment.Exit(-1);
            }

            log.Info("init storage " + diTarget.FullName);
            ObjectStorage store = new ObjectStorage(diTarget, configuration);

            store.GarbageCollect(timestamp);
        }