<commit_before>﻿using System;
using System.Linq;
using Raven.Client.Linq;
using Spinvoice.Domain.Exchange;

namespace Spinvoice.Infrastructure.DataAccess
{
    public class ExchangeRateDataAccess : BaseDataAccess<Rate>, IExchangeRateDataAccess
    {
        public ExchangeRateDataAccess(IDocumentStoreRepository documentStoreRepository)
            : base(documentStoreRepository)
        {
        }

        public Rate GetRate(string currency, DateTime date)
        {
            using (var session = DocumentStore.OpenSession())
            {
               return session.Query<Rate>()
                    .Customize(x => x.WaitForNonStaleResultsAsOfNow())
                    .FirstOrDefault(r => r.Currency == currency && r.Date == date);
            }
        }
    }
}<commit_msg>Added bigger timeout for ex rate query<commit_after>﻿using System;
using System.Linq;
using Raven.Client.Linq;
using Spinvoice.Domain.Exchange;

namespace Spinvoice.Infrastructure.DataAccess
{
    public class ExchangeRateDataAccess : BaseDataAccess<Rate>, IExchangeRateDataAccess
    {
        public ExchangeRateDataAccess(IDocumentStoreRepository documentStoreRepository)
            : base(documentStoreRepository)
        {
        }

        public Rate GetRate(string currency, DateTime date)
        {
            using (var session = DocumentStore.OpenSession())
            {
               return session.Query<Rate>()
                    .Customize(x => x.WaitForNonStaleResultsAsOfNow(TimeSpan.FromMinutes(2)))
                    .FirstOrDefault(r => r.Currency == currency && r.Date == date);
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.08773006134969324, 'fraction_numerical': 0.0006134969325153375, 'mean_word_length': 2.426470588235294, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6612934', 'n_tokens_mistral': 422, 'n_tokens_neox': 410, 'n_words': 82}