Beispiel #1
0
 public void InitDB()
 {
     string dbPath = Path.Combine (Path.GetTempPath (), "TestDB");
     if (Directory.Exists (dbPath)) {
         Directory.Delete (dbPath, true);
     }
     storage = new CouchbaseStorage (dbPath, "test-db");
     db = storage.Database;
 }
Beispiel #2
0
        public FetchedJob(CouchbaseStorage storage, Documents.Queue data)
        {
            bucket = storage.Client.OpenBucket(storage.Options.DefaultBucket);

            Id    = data.Id;
            JobId = data.JobId;

            TimeSpan keepAliveInterval = TimeSpan.FromMinutes(5);

            timer = new Timer(KeepAliveJobCallback, null, keepAliveInterval, keepAliveInterval);
        }
Beispiel #3
0
 public void InitDB()
 {
     string dbPath = Path.Combine (Path.GetTempPath (), Path.GetRandomFileName ());
     if (Directory.Exists (dbPath)) {
         Directory.Delete (dbPath, true);
     }
     try {
         storage = new CouchbaseStorageLongoMatch (dbPath, "test-db");
     } catch (Exception ex) {
         throw ex;
     }
     db = storage.Database;
 }
Beispiel #4
0
        public void InitDB()
        {
            string dbPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());

            if (Directory.Exists(dbPath))
            {
                Directory.Delete(dbPath, true);
            }
            try {
                storage = new CouchbaseStorageLongoMatch(dbPath, "test-db");
            } catch (Exception ex) {
                throw ex;
            }
            db = storage.Database;
        }
Beispiel #5
0
        public void InitDB()
        {
            string dbPath = Path.Combine(Path.GetTempPath(), "TestDB");

            if (Directory.Exists(dbPath))
            {
                Directory.Delete(dbPath, true);
            }
            try {
                storage = new DummyCouchbaseStorage(dbPath, "test-db");
            } catch (Exception ex) {
                throw ex;
            }
            db = storage.Database;
        }
        /// <summary>
        /// Enables to attach Couchbase to Hangfire
        /// </summary>
        /// <param name="global">The IGlobalConfiguration object</param>
        /// <param name="sectionName">The xml configuration section name</param>
        /// <param name="defaultBucket">The default name of the bucket to use</param>
        /// <param name="options">The CouchbaseStorageOptions object to override any of the options</param>
        /// <returns></returns>
        public static IGlobalConfiguration <CouchbaseStorage> UseCouchbaseStorage(this IGlobalConfiguration global, string sectionName, string defaultBucket = "default", CouchbaseStorageOptions options = null)
        {
            if (global == null)
            {
                throw new ArgumentNullException(nameof(global));
            }
            if (string.IsNullOrEmpty(sectionName))
            {
                throw new ArgumentNullException(nameof(sectionName));
            }
            if (string.IsNullOrEmpty(defaultBucket))
            {
                throw new ArgumentNullException(nameof(defaultBucket));
            }

            CouchbaseStorage storage = new CouchbaseStorage(sectionName, defaultBucket, options);

            return(global.UseStorage(storage));
        }
Beispiel #7
0
 public TestView(CouchbaseStorage storage) : base(storage)
 {
 }
Beispiel #8
0
 public TeamsView(CouchbaseStorage storage) : base(storage)
 {
     DocumentType = "Team";
 }
 public JobQueue(CouchbaseStorage storage)
 {
     this.storage       = storage;
     defaultLockTimeout = TimeSpan.FromSeconds(15) + storage.Options.QueuePollInterval;
 }
Beispiel #10
0
 public PlayersView(CouchbaseStorage storage) : base(storage)
 {
     DocumentType = "Player";
 }
Beispiel #11
0
 public EventTypeView(CouchbaseStorage storage) : base(storage)
 {
     DocumentType = "EventType";
 }
Beispiel #12
0
 public DashboardsView(CouchbaseStorage storage) : base(storage)
 {
     DocumentType = "Dashboard";
 }
Beispiel #13
0
 public TimelineEventsView(CouchbaseStorage storage) : base(storage)
 {
 }
Beispiel #14
0
 public StorableView(CouchbaseStorage storage) : base(storage)
 {
 }
Beispiel #15
0
 public JobQueueProvider(CouchbaseStorage storage)
 {
     queue           = new JobQueue(storage);
     monitoringQueue = new JobQueueMonitoringApi(storage);
 }
Beispiel #16
0
 public PlaylistView(CouchbaseStorage storage) : base(storage)
 {
     DocumentType = "Playlist";
 }
Beispiel #17
0
 public StorableImageTestView(CouchbaseStorage storage) : base(storage)
 {
 }
Beispiel #18
0
 public ProjectsView(CouchbaseStorage storage) : base(storage)
 {
     DocumentType = "Project";
 }
Beispiel #19
0
 protected GenericView(CouchbaseStorage storage) : base(storage)
 {
 }
Beispiel #20
0
 public JobQueueMonitoringApi(CouchbaseStorage storage) => this.storage = storage;