Skip to content

Commit

Permalink
Merge pull request #516 from supabase/fix_490
Browse files Browse the repository at this point in the history
disable sync_writes to fix #490
  • Loading branch information
imor authored Apr 29, 2024
2 parents 9113aaf + 093d14a commit b5b45e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
9 changes: 3 additions & 6 deletions src/graphql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,7 @@ pub enum __Type {
#[cached(
type = "SizedCache<u64, HashMap<String, __Field>>",
create = "{ SizedCache::with_size(1000) }",
convert = r#"{ calculate_hash(type_) }"#,
sync_writes = true
convert = r#"{ calculate_hash(type_) }"#
)]
pub fn field_map(type_: &__Type) -> HashMap<String, __Field> {
let mut hmap = HashMap::new();
Expand All @@ -570,8 +569,7 @@ pub fn field_map(type_: &__Type) -> HashMap<String, __Field> {
#[cached(
type = "SizedCache<u64, HashMap<String, __InputValue>>",
create = "{ SizedCache::with_size(1000) }",
convert = r#"{ calculate_hash(type_) }"#,
sync_writes = true
convert = r#"{ calculate_hash(type_) }"#
)]
pub fn input_field_map(type_: &__Type) -> HashMap<String, __InputValue> {
let mut hmap = HashMap::new();
Expand Down Expand Up @@ -3875,8 +3873,7 @@ pub struct __Schema {
#[cached(
type = "SizedCache<String, HashMap<String, __Type>>",
create = "{ SizedCache::with_size(200) }",
convert = r#"{ serde_json::ser::to_string(&schema.context.config).expect("schema config should be a string") }"#,
sync_writes = true
convert = r#"{ serde_json::ser::to_string(&schema.context.config).expect("schema config should be a string") }"#
)]
pub fn type_map(schema: &__Schema) -> HashMap<String, __Type> {
let tmap: HashMap<String, __Type> = schema
Expand Down
3 changes: 1 addition & 2 deletions src/sql_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,8 +791,7 @@ pub fn calculate_hash<T: Hash>(t: &T) -> u64 {
#[cached(
type = "SizedCache<u64, Result<Arc<Context>, String>>",
create = "{ SizedCache::with_size(250) }",
convert = r#"{ calculate_hash(_config) }"#,
sync_writes = true
convert = r#"{ calculate_hash(_config) }"#
)]
pub fn load_sql_context(_config: &Config) -> Result<Arc<Context>, String> {
// cache value for next query
Expand Down

0 comments on commit b5b45e8

Please sign in to comment.