示例#1
0
        // ReSharper disable once UnusedParameter.Local
        static int Main(string[] args)
        {
            int resultCode;

            using (var log = new ConsoleLog())
                using (var logger = new Logger(log))
                {
                    try
                    {
                        using (var fileSystem = new PassThroughFileSystem())
                            using (var directory = new DisposableDirectory(fileSystem))
                                using (var store = new SQLiteMemoizationStore(logger, directory.Path, SystemClock.Instance, long.MaxValue))
                                {
                                    var context = new Context(logger);

                                    // ReSharper disable once AccessToDisposedClosure
                                    resultCode = TaskSafetyHelpers.SyncResultOnThreadPool(() => RunStore(context, store));
                                }
                    }
                    catch (Exception exception)
                    {
                        logger.Error($"Unexpected error: {exception}");
                        resultCode = 1;
                    }
                }

            return(resultCode);
        }
示例#2
0
        /// <nodoc />
        public ReadOnlySQLiteMemoizationSession(string name, SQLiteMemoizationStore memoizationStore)
        {
            Contract.Requires(name != null);
            Contract.Requires(memoizationStore != null);

            Tracer           = new Tracer(name);
            Name             = name;
            MemoizationStore = memoizationStore;
        }
示例#3
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="SQLiteMemoizationSession" /> class.
 /// </summary>
 /// <remarks>
 ///     Allowing contentSession to be null to allow the creation of uncoupled MemoizationSessions.
 ///     While we might extend this to the actual interface at some point, for now it's just a test hook
 ///     to compare to the previous behavior.  With a null content session, metadata will be automatically
 ///     overwritten because we're unable to check whether or not content is missing.
 /// </remarks>
 public SQLiteMemoizationSession(string name, SQLiteMemoizationStore memoizationStore, IContentSession contentSession = null)
     : base(name, memoizationStore)
 {
     _contentSession = contentSession;
 }