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